問(wèn)題:pip install時(shí)迈窟,報(bào) Can't connect to HTTPS URL because the SSL module is not available
分析:
1. ssl是否安裝?brew install openssl顯示已安裝采缚;
2. ssl是否正常瓶竭?
? ? a. python中督勺,import正常
? ? b. 運(yùn)行openssl,報(bào)以下異常
?dyld: Symbol not found: _d2i_ECPKParameters
? Referenced from: /usr/local/opt/openssl/bin/openssl
? Expected in: /Users/xxx/WorkSpace/STAF/lib/libcrypto.1.0.0.dylib
?in /usr/local/opt/openssl/bin/openssl
zsh: abort? ? ? openssl --version
3. 重新編譯openssl是否正常斤贰?編譯后報(bào)相同錯(cuò)誤智哀,確認(rèn)為ssl與libcrypto之間問(wèn)題
問(wèn)題根源和解決辦法:(來(lái)自https://mithun.co/hacks/library-not-loaded-libcrypto-1-0-0-dylib-issue-in-mac/)
You might have come across this error while dealing with the openssl module.
Inorder to solve this issue follow the following steps
Step 1: Install openssl using brew
brew install openssl
Step 2: Copy?copy libssl.1.0.0.dylib and libcrypto.1.0.0.dylib
cd /usr/local/Cellar/openssl/1.0.1f/lib
sudo cp libssl.1.0.0.dylib libcrypto.1.0.0.dylib /usr/lib/
Note the?bold folder name. There will be change in that depending on your openssl version
Step 3: Remove the existing links
sudo rm libssl.dylib libcrypto.dylib
sudo ln -s libssl.1.0.0.dylib libssl.dylib
sudo ln -s libcrypto.1.0.0.dylib libcrypto.dylib
That’s it. Now try installing what you have been trying to install.
I hope this helps. If you need any further clarification, do comment.
Done