【发布时间】:2015-12-02 08:48:19
【问题描述】:
我想为 python3 安装 virtualenv。 在过去的一个小时里,我一直在尝试解决这个问题,但没有运气。
root@XXXX:~# pip3 install virtualenv
Downloading/unpacking virtualenv
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement virtualenv
Cleaning up...
No distributions at all found for virtualenv
Storing debug log for failure in /root/.pip/pip.log
root@XXXX:~# vim /root/.pip/pip.log
root@XXXX:~# pip install virtualenv
Downloading/unpacking virtualenv
Downloading virtualenv-13.1.2-py2.py3-none-any.whl (1.7MB): 1.7MB downloaded
Installing collected packages: virtualenv
Successfully installed virtualenv
Cleaning up...
如您所见,pip 工作正常,但 pip3 超时。
根据失败的 pip.log 输出,pip3 尝试向 pypi 请求超时:
/usr/bin/pip3 run on Wed Dec 2 08:45:51 2015
Downloading/unpacking virtualenv
Getting page https://pypi.python.org/simple/virtualenv/
Could not fetch URL https://pypi.python.org/simple/virtualenv/: timed out
Will skip URL https://pypi.python.org/simple/virtualenv/ when looking for download links for virtualenv
Getting page https://pypi.python.org/simple/
Could not fetch URL https://pypi.python.org/simple/: timed out
Will skip URL https://pypi.python.org/simple/ when looking for download links for virtualenv
Cannot fetch index base URL https://pypi.python.org/simple/
URLs to search for versions for virtualenv:
* https://pypi.python.org/simple/virtualenv/
Getting page https://pypi.python.org/simple/virtualenv/
Could not fetch URL https://pypi.python.org/simple/virtualenv/: timed out
Will skip URL https://pypi.python.org/simple/virtualenv/ when looking for download links for virtualenv
Could not find any downloads that satisfy the requirement virtualenv
Cleaning up...
Removing temporary dir /tmp/pip_build_root...
No distributions at all found for virtualenv
Exception information:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/lib/python3/dist-packages/pip/req.py", line 1178, in prepare_files
url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
File "/usr/lib/python3/dist-packages/pip/index.py", line 277, in find_requirement
raise DistributionNotFound('No distributions at all found for %s' % req)
pip.exceptions.DistributionNotFound: No distributions at all found for virtualenv
任何关于我如何解决这个问题的提示都会很棒。提前致谢。
【问题讨论】:
标签: python python-3.x pip