OSX上的加密升级问题

2024-03-29 10:32:04 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图安装Scrapy,但遇到了openssl错误。所有论坛似乎都建议通过更新密码来解决这个问题,但我在升级密码时也遇到了一个错误。在

我正在运行macOS Catalina 10.15.1。我已经更新了我的xcode、pip和brew。我怎么解决这个问题?在

$ pip install cryptography

WARNING: Executing a script that is loading libcrypto in an unsafe way. This will fail in a future version of macOS. Set the LIBRESSL_REDIRECT_STUB_ABORT=1 in the environment to force this into an error.
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Requirement already satisfied: cryptography in /Library/Python/2.7/site-packages (2.1.3)
Requirement already satisfied: cffi>=1.7; platform_python_implementation != "PyPy" in /Library/Python/2.7/site-packages (from cryptography) (1.11.2)
Requirement already satisfied: enum34; python_version < "3" in /Library/Python/2.7/site-packages (from cryptography) (1.1.6)
Requirement already satisfied: asn1crypto>=0.21.0 in /Library/Python/2.7/site-packages (from cryptography) (0.23.0)
Requirement already satisfied: idna>=2.1 in /Library/Python/2.7/site-packages (from cryptography) (2.6)
Requirement already satisfied: six>=1.4.1 in /Library/Python/2.7/site-packages (from cryptography) (1.11.0)
Requirement already satisfied: ipaddress; python_version < "3" in /Library/Python/2.7/site-packages (from cryptography) (1.0.18)
Requirement already satisfied: pycparser in /Library/Python/2.7/site-packages (from cffi>=1.7; platform_python_implementation != "PyPy"->cryptography) (2.18)
From cffi callback <function _verify_callback at 0x10e937230>:
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/OpenSSL/SSL.py", line 309, in wrapper
    _lib.X509_up_ref(x509)
AttributeError: 'module' object has no attribute 'X509_up_ref'
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),)) - skipping


^{pr2}$

Tags: pipoftheinfromsupportversionpackages
1条回答
网友
1楼 · 发布于 2024-03-29 10:32:04

这个问题是一组依赖项之间的复杂交互,最终破坏了pip通过TLS获取内容的能力,但是最简单的解决方法是使用浏览器从https://pypi.org/project/cryptography/#files下载右轮文件,然后键入pip install /path/to/wheel/wheel-file.whl。在编写本文时,应该适合您的wheel文件是cryptography-2.8-cp27-cp27m-macosx_10_6_intel.whl。在

相关问题 更多 >