pip3失败但是pip与virtualenv一起工作正常

时间:2015-12-02 08:48:20

标签: python python-3.x pip

我想为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

关于如何解决这个问题的任何提示都会很棒。提前谢谢。

1 个答案:

答案 0 :(得分:2)

pip3没有virtualenv,但很容易设置一个新的环境来使用python3

  1. 您使用普通的点子
  2. 安装它

    <div id="question_list"> </div> <button type="button" id="add_question">Add question</button> <div id="question_template" style="display:none"> <label for="question_content">Question content</label> <input type="text" name="[question_content]"/><br/> <input type="hidden" name="[id_question]" value=""/> </div>

    1. 将新的virtualenv配置为使用python3
    2. <MajorUpgrade AllowDowngrades="no" AllowSameVersionUpgrades="no" Schedule="afterInstallValidate" DowngradeErrorMessage="Newer version of [ProductName] is already installed."/>