您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

Python中的SSL模块不可用(在OSX上)

Python中的SSL模块不可用(在OSX上)

ssl模块及其基础的C扩展似乎是python公式的一部分:

Mac-Admin:~ admin$ python3
Python 3.7.4 (default, Sep  7 2019, 18:27:02) 
[Clang 10.0.1 (clang-1001.0.46.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>> ssl
<module 'ssl' from '/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py'>
>>> import _ssl
>>> _ssl
<module '_ssl' from '/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_ssl.cpython-37m-darwin.so'>

因此丢失它很可能意味着brew reinstall python应修复的软件包安装损坏。

还要注意,尽管Homebrew允许多个版本共存,但其安装逻辑并非旨在使替代版本能够正常运行,除非它们是通过版本化公式安装的(例如,定期删除常规版本中的旧版本brew cleanup)。

因此,如果您需要在Python版本之间进行常规切换,或考虑为其提供版本化公式的某些第三方水龙头,请考虑使用pyenv(也可以通过提供brew)。

python 2022/1/1 18:31:29 有214人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶