Linux笔记-Caused by SSLError(“Can‘t connect to HTTPS URL because the SSL module is not available.“)
这里是我用把Python用pyinstaller打包后,出现的问题。安装好后,再重按下Python3。解决是重安下OpenSSL。
·
这里是我用把Python用pyinstaller打包后,出现的问题。
解决是重安下OpenSSL。
wget http://www.openssl.org/source/openssl-1.0.2j.tar.gz
tar -zxvf openssl-1.0.2j.tar.gz
cd openssl-1.0.2j
./config --prefix=/usr/local/openssl shared zlib
make && make install
安装好后,再重按下Python3
./configure --prefix=/usr/local/python3 -enable-shared
cd Modules
vi Setup
修改如下内容:
...
# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
SSL=/usr/local/openssl/
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto
设置好软连接:
ln -s /usr/local/openssl/lib/libssl.so.1.0.0 /usr/lib64/libssl.so.1.0.0
ln -s /usr/local/openssl/lib/libcrypto.so.1.0.0 /usr/lib64/libcrypto.so.1.0.0
cd ..
make && make install
最后重新打包就好了:
pyinstaller xxx.py
更多推荐
所有评论(0)