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

Logo

GitCode 天启AI是一款由 GitCode 团队打造的智能助手,基于先进的LLM(大语言模型)与多智能体 Agent 技术构建,致力于为用户提供高效、智能、多模态的创作与开发支持。它不仅支持自然语言对话,还具备处理文件、生成 PPT、撰写分析报告、开发 Web 应用等多项能力,真正做到“一句话,让 Al帮你完成复杂任务”。

更多推荐