简体   繁体   English

在Windows上的virtualenv中使用pip和easy_install

[英]Using pip and easy_install in virtualenv on Windows

I was trying to install a few packages in a virtual environment using pip. 我试图使用pip在虚拟环境中安装一些软件包。 I was getting the error: 我收到错误:

Downloading/unpacking pymongo
  Cannot fetch index base URL https://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement pymongo
No distributions at all found for pymongo

I found that some say a workaround is downgrading your pip. 我发现有人说解决方法会降低您的点数。 I downloaded and installed pip 1.2.1 Now I get the error: 我下载并安装了pip 1.2.1,现在出现错误:

(env1)PS C:\dev\virtualenvs> pip install bottle
Downloading/unpacking bottle
  Cannot fetch index base URL http://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement bottle
No distributions at all found for bottle

The log says: 日志显示:

urlopen error [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissions>

How do I correctly use virtualenvs on windows? 如何在Windows上正确使用virtualenvs?

EDIT: I am able to use pip when not in my virtualenv. 编辑:当我不在virtualenv时,我可以使用pip。

In this case the operating system should not matter. 在这种情况下,操作系统应该无关紧要。 Also this should not be a question about virtualenv (as suggested in your title). 同样,这也不应该是关于virtualenv的问题(如标题中所建议)。 pip just cannot access the remote end that it would like to access. pip不能访问它想要访问的远端。 Does it take some time for the error message to appear (is this a timeout issue)? 错误消息是否需要花费一些时间(这是超时问题)? If yes, then this is a networking issue, maybe triggered by a firewall. 如果是,则这是网络问题,可能是由防火墙触发的。 You should check this first. 您应该先检查一下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM