当我尝试在我的 Ubuntu 18.04.2 LTS/Python 3.6.8/Python 2.7.15+ 机器上安装任何包时,我收到 No files/directories in/tmp/*
错误。
例如,
pip install pyx
Collecting pyx
Using cached https://files.pythonhosted.org/packages/f7/25/59c136568c1b61ee087155c874fcd9f7196a943a6a5ee3429efeb30ea2a8/PyX-0.15.tar.gz
No files/directories in /tmp/pip-build-nRurCC/pyx/pip-egg-info (from PKG-INFO)
我尝试安装的每个包都会出现这种情况。
sudo
没有帮助。- 提出解决方案 here ,使用
--no-cache-dir 选项
,没有帮助。
使用 vvv
选项运行 pip install 命令的输出结果如下。
No files/directories in /tmp/pip-build-VU1cex/pyx/pip-egg-info (from PKG-INFO)
Exception information:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 342, in run
requirement_set.prepare_files(finder)
File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 634, in _prepare_file
abstract_dist.prep_for_dist()
File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 129, in prep_for_dist
self.req_to_install.run_egg_info()
File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 455, in run_egg_info
metadata_name = canonicalize_name(self.pkg_info()["Name"])
File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 533, in pkg_info
data = self.egg_info_data('PKG-INFO')
File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 471, in egg_info_data
filename = self.egg_info_path(filename)
File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 515, in egg_info_path
'No files/directories in %s (from %s)' % (base, filename)
InstallationError: No files/directories in /tmp/pip-build-VU1cex/pyx/pip-egg-info (from PKG-INFO)
最佳答案
我认为这是一个上游问题,我尝试了很多事情,甚至使用最新的提交 pip install git+https://github.com/pyx-project/pyx.git@fc66c078727b02693b122ad346b9fa5472e06eb7
安装,拜托试试这个版本:pip install PyX==0.12
它应该可以工作。
关于python - pip 错误/tmp/中没有文件/目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57326736/