OS X Python 3.7 openssl 终极冲突解决大法(PART 2)
前文:OS X Python 3.7 openssl 终极冲突解决大法(PART 1)
继续思考问题
继续昨天的思路,思考一个问题:官网下载的Python3.7安装后能够完美的使用openssl,而Homebrew安装的就不行,肯定是差了一些东西,既然已经安装了openssl,那么有可能是配置文件又问题?或者是系统路径设置问题?或者是缺少一些引用文件?
一步步来找到问题所在,首先,看看Python导入SSL时有什么错误:
$ python3
Python 3.7.2 (default, Feb 12 2019, 08:16:11)
[Clang 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 98, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: dlopen(/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3