简体   繁体   English

在Windows上使用pip安装virtualenv时出错

[英]Error while installing virtualenv using pip on Windows

Trying to install virtualenv using pip on windows machine but facing below error 尝试在Windows计算机上使用pip安装virtualenv,但遇到以下错误

pip install virtualenv
    Collecting virtualenv
    Exception:
    Traceback (most recent call last): File "c:\python27\lib\site-packages\pip\basecommand.py", line 215, in main status = self.run(options, args)
    File "c:\python27\lib\site-packages\pip\commands\install.py", line 324, in run
    requirement_set.prepare_files(finder)
    File "c:\python27\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files ignore_dependencies=self.ignore_dependencies))
    File "c:\python27\lib\site-packages\pip\req\req_set.py", line 620, in _prepare_file session=self.session, hashes=hashes)
    File "c:\python27\lib\site-packages\pip\download.py", line 821, in unpack_url hashes=hashes
    File "c:\python27\lib\site-packages\pip\download.py", line 659, in unpack_http_url hashes)
    File "c:\python27\lib\site-packages\pip\download.py", line 853, in _download_http_url stream=True,
    File "c:\python27\lib\site-packages\pip\_vendor\requests\sessions.py", line 488, in get return self.request('GET', url, **kwargs)
    File "c:\python27\lib\site-packages\pip\download.py", line 386, in request return super(PipSession, self).request(method, url, *args, **kwargs)
    File "c:\python27\lib\site-packages\pip\_vendor\requests\sessions.py", line 475, in request resp = self.send(prep, **send_kwargs)
    File "c:\python27\lib\site-packages\pip\_vendor\requests\sessions.py", line 596, in send r = adapter.send(request, **kwargs)
    File "c:\python27\lib\site-packages\pip\_vendor\cachecontrol\adapter.py", line 47, in send resp = super(CacheControlAdapter, self).send(request, **kw)
    File "c:\python27\lib\site-packages\pip\_vendor\requests\adapters.py", line 497, in send raise SSLError(e, request=request)
    SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)
    You are using pip version 9.0.1, however version 10.0.1 is available.
    You should consider upgrading via the 'python -m pip install --upgrade pip' command.

Have you tried using cmd line as an administrator to run below, 您是否尝试过使用cmd line作为管理员在下面运行,

pip install virtualenv

virtualenv comes with a copy of pip which gets copied into every new environment you create so virtualenv is all that is requried. virtualenv附带了一个pip副本,该副本被复制到您创建的每个新环境中,因此,virtualenv就是所需要的全部。 You can try installing virtualenv separately as a standalone package. 您可以尝试将virtualenv作为独立软件包单独安装。 Which is actually easier for windows users. 对于Windows用户而言,这实际上更容易。 See https://virtualenv.pypa.io/en/stable/ for instructions. 有关说明,请参见https://virtualenv.pypa.io/en/stable/

you need to upgrade PIP first 您需要先升级画中画

python -m pip install --upgrade pip

then you can install your package Via Administrator Acces 然后您可以通过Administrator Acces安装软件包

pip install virtualenv

Issue resolved! 问题解决了! There was an issue with the pip that came with Python 2.7.13, saved this file ( https://bootstrap.pypa.io/get-pip.py ) and then command 'python get-pip.py' solved the problem by upgrading it. Python 2.7.13随附的pip出现问题,保存了该文件( https://bootstrap.pypa.io/get-pip.py ),然后命令'python get-pip.py'通过以下方式解决了该问题:升级它。 As the command 'python -m pip install --upgrade pip' was itself giving the same error as mentioned above. 由于命令'python -m pip install --upgrade pip'本身给出了与上述相同的错误。 Thanks all! 谢谢大家!

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

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