【发布时间】:2020-05-15 09:13:16
【问题描述】:
我在运行 pip install 时遇到问题,以便我可以在现有环境中安装 tensorflow。但是,它一直因无空间错误而崩溃。在我的研究中,我发现 pip 默认情况下会将其包下载到 /tmp。由于它位于根目录下,因此我尝试进行 pip 下载以进行离线安装,并将文件下载到 /home 下的目录中。这失败了,同样的错误。
pip download --no-cache-dir tensorflow -d /home/profile1/tmp/
#downloads several packages
Traceback (most recent call last):
File "/home/profile1/anaconda3/envs/testinstall/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 186, in _main
status = self.run(options, args)
File "/home/profile1/anaconda3/envs/testinstall/lib/python3.6/site-packages/pip/_internal/commands/download.py", line 135, in run
resolver.resolve(requirement_set)
File "/home/profile1/anaconda3/envs/testinstall/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py", line 177, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "/home/profile1/anaconda3/envs/testinstall/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py", line 333, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/home/profile1/anaconda3/envs/testinstall/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py", line 282, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(req)
File "/home/profile1/anaconda3/envs/testinstall/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 482, in prepare_linked_requirement
hashes=hashes,
File "/home/profile1/anaconda3/envs/testinstall/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 287, in unpack_url
hashes=hashes,
File "/home/profile1/anaconda3/envs/testinstall/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 164, in unpack_http_url
unpack_file(from_path, location, content_type)
File "/home/profile1/anaconda3/envs/testinstall/lib/python3.6/site-packages/pip/_internal/utils/unpacking.py", line 252, in unpack_file
flatten=not filename.endswith('.whl')
File "/home/profile1/anaconda3/envs/testinstall/lib/python3.6/site-packages/pip/_internal/utils/unpacking.py", line 139, in unzip_file
shutil.copyfileobj(fp, destfp)
File "/home/profile1/anaconda3/envs/testinstall/lib/python3.6/shutil.py", line 82, in copyfileobj
fdst.write(buf)
OSError: [Errno 28] No space left on device
在使用 `df -h /home' 时,我看到文件系统中还有 20 GB,所以这没有任何意义。就补救而言,我还能做些什么吗?
我还能够确认这仅适用于 pip;我能够使用 conda install 来获取 tensorflow,但不能使用 pip。另外,我在尝试下载torch时也发现了同样的错误。
【问题讨论】:
-
也许this 会有所帮助?
-
我需要试试这个;但是,其他人使用此服务器,所以我需要先与他们清除它,以防更改 TMPDIR 对他们有影响。
标签: python download pip installation