Problems with new notebooks on Paperspace Gradient

I created and account on Paperspace Gradient and followed the instructions: https://course.fast.ai/start_gradient.html

Everything was well, when I’m executing code in the notebooks in the fastbook folder. However, when I create a new notebook and import fastai, it seems like I cannot access its functions:

Hey Mateusz,

Have you made sure that fastai is updated? It’s always a good idea to run !pip install -U fastai (and maybe also fastcore) when you first boot up a new cloud instance. Let me know if the problem persists :slight_smile:

Thanks, I tried running it in the terminal and that’s what I’ve got:

root@0de19359b26b:/notebooks# pip install -U fastai
Collecting fastai
Using cached fastai-2.1.2-py3-none-any.whl (188 kB)
Requirement already satisfied, skipping upgrade: matplotlib in /opt/conda/envs/fastai/lib/python3.8/site-packages (from fastai) (3.3.1)
Requirement already satisfied, skipping upgrade: requests in /opt/conda/envs/fastai/lib/python3.8/site-packages (from fastai)(2.24.0)
Requirement already satisfied, skipping upgrade: fastcore>=1.3.0 in /opt/conda/envs/fastai/lib/python3.8/site-packages (from fastai) (1.3.1)
Requirement already satisfied, skipping upgrade: scikit-learn in /opt/conda/envs/fastai/lib/python3.8/site-packages (from fastai) (0.23.2)
Requirement already satisfied, skipping upgrade: fastprogress>=0.2.4 in /opt/conda/envs/fastai/lib/python3.8/site-packages (from fastai) (1.0.0)
Requirement already satisfied, skipping upgrade: spacy in /opt/conda/envs/fastai/lib/python3.8/site-packages (from fastai) (2.3.2)
Requirement already satisfied, skipping upgrade: pandas in /opt/conda/envs/fastai/lib/python3.8/site-packages (from fastai) (1.1.0)
Requirement already satisfied, skipping upgrade: pyyaml in /opt/conda/envs/fastai/lib/python3.8/site-packages (from fastai) (5.3.1)
Collecting torch>=1.7.0
ERROR: Exception:
Traceback (most recent call last):
File “/opt/conda/envs/fastai/lib/python3.8/site-packages/pip/_internal/cli/base_command.py”, line 216, in _main
status = self.run(options, args)
File “/opt/conda/envs/fastai/lib/python3.8/site-packages/pip/_internal/cli/req_command.py”, line 182, in wrapper
return func(self, options, args)
File “/opt/conda/envs/fastai/lib/python3.8/site-packages/pip/_internal/commands/install.py”, line 324, in run
requirement_set = resolver.resolve(
File “/opt/conda/envs/fastai/lib/python3.8/site-packages/pip/_internal/resolution/legacy/resolver.py”, line 183, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File “/opt/conda/envs/fastai/lib/python3.8/site-packages/pip/_internal/resolution/legacy/resolver.py”, line 388, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File “/opt/conda/envs/fastai/lib/python3.8/site-packages/pip/_internal/resolution/legacy/resolver.py”, line 340, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(req)
File “/opt/conda/envs/fastai/lib/python3.8/site-packages/pip/_internal/operations/prepare.py”, line 467, in prepare_linked_requirement
local_file = unpack_url(
File “/opt/conda/envs/fastai/lib/python3.8/site-packages/pip/_internal/operations/prepare.py”, line 255, in unpack_url
file = get_http_url(
File “/opt/conda/envs/fastai/lib/python3.8/site-packages/pip/_internal/operations/prepare.py”, line 129, in get_http_url
from_path, content_type = _download_http_url(
File “/opt/conda/envs/fastai/lib/python3.8/site-packages/pip/_internal/operations/prepare.py”, line 278, in _download_http_url
download = downloader(link)
File “/opt/conda/envs/fastai/lib/python3.8/site-packages/pip/_internal/network/download.py”, line 170, in call
resp = _http_get_download(self._session, link)
File “/opt/conda/envs/fastai/lib/python3.8/site-packages/pip/_internal/network/download.py”, line 139, in _http_get_download
resp = session.get(target_url, headers=HEADERS, stream=True)
File “/opt/conda/envs/fastai/lib/python3.8/site-packages/pip/_vendor/requests/sessions.py”, line 543, in get
return self.request(‘GET’, url, **kwargs)
File “/opt/conda/envs/fastai/lib/python3.8/site-packages/pip/_internal/network/session.py”, line 421, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File “/opt/conda/envs/fastai/lib/python3.8/site-packages/pip/_vendor/requests/sessions.py”, line 530, in request
resp = self.send(prep, **send_kwargs)
File “/opt/conda/envs/fastai/lib/python3.8/site-packages/pip/_vendor/requests/sessions.py”, line 643, in send
r = adapter.send(request, **kwargs)
File “/opt/conda/envs/fastai/lib/python3.8/site-packages/pip/_vendor/cachecontrol/adapter.py”, line 44, in send
cached_response = self.controller.cached_request(request)
File “/opt/conda/envs/fastai/lib/python3.8/site-packages/pip/_vendor/cachecontrol/controller.py”, line 145, in cached_request
resp = self.serializer.loads(request, cache_data)
File “/opt/conda/envs/fastai/lib/python3.8/site-packages/pip/_vendor/cachecontrol/serialize.py”, line 82, in loads
ver, data = data.split(b",", 1)
MemoryError

Same here! exactly the same error. Any suggestions? Thanks.

same error here :raised_back_of_hand:

I got the same error when upgrading fastai in the terminal. Adding the --no-cache-dir option solved it for me. Might be worth a try.

Yes, adding --no-cache-dir worked.
Many thanks Espen!!

The terminal command pip install fastai fastcore --upgrade --no-cache-dir worked here too :wink: thanks!

For me it did solve the terminal problem, but not the one in the notebook. It still seems like I cannot properly *star-import fastai. Any ideas?