Python 为什么可以';我不能安装virtualenv吗?什么是无匹配分布错误?

Python 为什么可以';我不能安装virtualenv吗?什么是无匹配分布错误?,python,virtualenv,Python,Virtualenv,我是python新手,我想安装virtualenv来做一些事情 我曾尝试使用pip和easy_install来安装它,但我收到了有关分发问题的错误消息 我的操作系统是MacOS 10.12.6,我以前在系统中安装过pycharm 这是sys.path ['', '/Library/Python/2.7/site-packages', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/Sys

我是python新手,我想安装virtualenv来做一些事情

我曾尝试使用pip和easy_install来安装它,但我收到了有关分发问题的错误消息

我的操作系统是MacOS 10.12.6,我以前在系统中安装过
pycharm

这是
sys.path

['', '/Library/Python/2.7/site-packages', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/Library/Python/2.7/site-packages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC']
易于安装

sudo easy_install virtualenv

Searching for virtualenv
Reading https://pypi.python.org/simple/virtualenv/
Download error on https://pypi.python.org/simple/virtualenv/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) -- Some packages may not be found!
Couldn't find index page for 'virtualenv' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) -- Some packages may not be found!
No local packages or download links found for virtualenv
error: Could not find suitable distribution for Requirement.parse('virtualenv')
pip

sudo pip install virtualenv

The directory '/Users/posen/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/posen/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting virtualenv
  Could not fetch URL https://pypi.python.org/simple/virtualenv/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) - skipping
  Could not find a version that satisfies the requirement virtualenv (from versions: )
No matching distribution found for virtualenv
我无法理解正在发生的事情,有人能建议我如何解决这个问题吗?

由于pip较旧的版本而发生。要解决此问题,可以使用此命令将pip升级到最新版本

pip install --upgrade virtualenv

解决此问题所需遵循的步骤如下:

  • 升级PIP
    PIP安装——升级PIP
  • 升级virtualenv
    pip安装--升级virtualenv

  • 什么版本的pip?先做这个
    curlhttps://bootstrap.pypa.io/get-pip.py |sudo python
    然后尝试重新安装这是一个问题:“无法获取URL:确认ssl证书时出现问题:[ssl:TLSV1\u ALERT\u PROTOCOL\u VERSION]TLSV1 ALERT PROTOCOL VERSION(\u ssl.c:590)”-您是否支持某种TLS代理?该站点正在使用ssl库无法理解的加密。你试过更新你的库吗?截至2018年6月30日,TLSv1已被弃用。检查此项。@GrantMcCloskey pip 9.0.1,来自/Library/Python/2.7/site-packages(Python 2.7)