Cob*_*bry 18 python pip python-2.7
我正在尝试使用get_pip.py文件在我的Mac Yosemite 10.10.5上安装pip,但我遇到以下问题
Bachirs-MacBook-Pro:Downloads bachiraoun$ sudo python get-pip.py
The directory '/Users/bachiraoun/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/bachiraoun/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 pip
/tmp/tmpOofplD/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
/tmp/tmpOofplD/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
Could not fetch URL https://pypi.python.org/simple/pip/: There was a problem confirming the ssl certificate: [Errno 1] _ssl.c:510: error:0D0890A1:asn1 encoding routines:ASN1_verify:unknown message digest algorithm - skipping
Could not find a version that satisfies the requirement pip (from versions: )
No matching distribution found for pip
Run Code Online (Sandbox Code Playgroud)
根据我的错误消息和urllib3我的问题是因为我有一个早于2.7.9的python安装版本,但我的python是2.7.10你可以看到
Bachirs-MacBook-Pro:docs bachiraoun$ python
Python 2.7.10 (default, Jul 14 2015, 19:46:27)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.version_info
sys.version_info(major=2, minor=7, micro=10, releaselevel='final', serial=0)
>>>
Run Code Online (Sandbox Code Playgroud)
我验证了我的openssl安装,它似乎没问题
Bachirs-MacBook-Pro:docs bachiraoun$ brew install openssl
Warning: openssl-1.0.2f already installed
Run Code Online (Sandbox Code Playgroud)
不确定如何解决这个问题,任何想法?
lbs*_*eek 25
需要安装:
pip install pyopenssl ndg-httpsclient pyasn1
Run Code Online (Sandbox Code Playgroud)
链接:http: //urllib3.readthedocs.org/en/latest/security.html#openssl-pyopenssl
默认情况下,我们使用标准库的ssl模块.不幸的是,PyOpenSSL解决了一些限制:
(Python 2.x)SNI支持.(Python 2.x-3.2)禁用压缩以缓解CRIME攻击.
要改为使用Python OpenSSL绑定,您需要安装所需的包:
pip install pyopenssl ndg-httpsclient pyasn1
Run Code Online (Sandbox Code Playgroud)
您的文件夹权限有问题。文件夹为
/Users/ME/Library/Caches/pip/http
Run Code Online (Sandbox Code Playgroud)
或者它的祖先之一不属于您打算与之交互的用户。您需要检查正在尝试执行此操作的用户,并且需要确保给定用户具有路径中所有文件夹的必要权限。