我正在尝试获取pyOpenSSL 18.0.0,但是它不起作用。这是我的命令:
sudo pip install pyOpenSSL==18.0.0
我明白了:
The directory '/Users/mac/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/mac/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.
Requirement already satisfied: pyOpenSSL==18.0.0 in ./Library/Python/2.7/lib/python/site-packages (18.0.0)
Requirement already satisfied: six>=1.5.2 in /Library/Python/2.7/site-packages (from pyOpenSSL==18.0.0) (1.11.0)
Requirement already satisfied: cryptography>=2.2.1 in ./Library/Python/2.7/lib/python/site-packages (from pyOpenSSL==18.0.0) (2.4.2)
Requirement already satisfied: idna>=2.1 in /Library/Python/2.7/site-packages (from cryptography>=2.2.1->pyOpenSSL==18.0.0) (2.7)
Requirement already satisfied: enum34; python_version < "3" in ./Library/Python/2.7/lib/python/site-packages (from cryptography>=2.2.1->pyOpenSSL==18.0.0) (1.1.6)
Requirement already satisfied: cffi!=1.11.3,>=1.7 in ./Library/Python/2.7/lib/python/site-packages (from cryptography>=2.2.1->pyOpenSSL==18.0.0) (1.11.5)
Requirement already satisfied: asn1crypto>=0.21.0 in ./Library/Python/2.7/lib/python/site-packages (from cryptography>=2.2.1->pyOpenSSL==18.0.0) (0.24.0)
Requirement already satisfied: ipaddress; python_version < "3" in ./Library/Python/2.7/lib/python/site-packages (from cryptography>=2.2.1->pyOpenSSL==18.0.0) (1.0.22)
Requirement already satisfied: pycparser in ./Library/Python/2.7/lib/python/site-packages (from cffi!=1.11.3,>=1.7->cryptography>=2.2.1->pyOpenSSL==18.0.0) (2.19)
看起来已经安装了pyOpenSSL。但随后我检查了:
pip list
我得到:
pyOpenSSL 0.13.1
答案 0 :(得分:1)
sudo
命令可能正在通过pip将pyopenssl
的该版本安装到root
用户的站点软件包中。只需运行pip install pyOpenSSL==18.0.0
(在虚拟环境外部),即可将其安装在当前用户的站点程序包中。
顺便说一句,您应该考虑使用虚拟环境来更好地管理python项目。为此,请参考{{this answer}。