gpt4 book ai didi

Linux笔记-Caused by SSLError(“Can‘t connect to HTTPS URL because the SSL module is not available.“)

转载 作者:知者 更新时间:2024-03-12 00:43:35 27 4
gpt4 key购买 nike

这里是我用把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

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com