我收到此錯誤:
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/OpenSSL/crypto.py:14:CryptographyDeprecationWarning:Python 核心團隊不再支持 Python 2。對它的支持現在在密碼學中已棄用,并將在下一個版本中洗掉。從密碼學匯入實用程式,x509
我已經嘗試更新密碼模塊和 python。這個問題的解決方案是什么?
uj5u.com熱心網友回復:
macOS Monterey/usr/bin/python以 Python 2.7.18 和一組默認包的形式發布。這個 Python 是作為與舊軟體兼容的最終后備提供的。執行 Apple 提供的 Python 時,您將看到以下初始訊息:
WARNING: Python 2.7 is not recommended.
This version is included in macOS for compatibility with legacy software.
Future versions of macOS will not include Python 2.7.
Instead, it is recommended that you transition to using 'python3' from within Terminal.
由于他們發布了一組已經發布多年的軟體包,其中包括cryptography,它也棄用了 Python 2 支持,并開始發出關于在 3.3 版中放棄支持的警告。Apple 發布了 3.3.2 版本,這是cryptography受支持的 Python 2 的最終版本。
唯一真正的解決方案是停止使用 Python 2。您可以從 python.org 安裝更新的 Python,使用 pyenv 或 conda 等工具,或使用 Apple 的 Python 3,但需要遷移。當然,蘋果很可能會在明年 macOS 13 發布時放棄他們的 py2 安裝。
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/428067.html
標籤:Python python-2.7 密码学
上一篇:匹配括號內的逗號分隔串列
