我升级了pyOpenSSL,但它仍然是0.13.1版本。无法升级到18.0.0

问题描述 投票:0回答:1

我试图得到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
scrapy pip web-crawler
1个回答
1
投票

sudo命令可能正在将pyopenssl版本的pip安装到root用户的site-packages。只需运行pip install pyOpenSSL==18.0.0(在虚拟环境之外),就应该将其安装在当前用户的站点包中。

另外,您应该考虑使用虚拟环境来更好地管理python项目。为此,请参考{this answer}。

© www.soinside.com 2019 - 2024. All rights reserved.