github下载
https://github.com/python/cpython/tree/3.7
centeos安装
tar -xzf cpython-3.7.tar.gz
cd cpython-3.7
mkdir /data/python3717
# 指定安装目录
./configure --prefix=/usr/local/python3 --with-ssl
# 安装
make install
# 建立软链接
ln -s /data/python3717/bin/python3.7 /usr/bin/python3
ln -s /data/python3717/bin/pip3 /usr/bin/pip3
# 安装需要的wheel
pip3 install xxx.wheel
# Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/itsdangerous/
pip3 install itsdangerous-2.1.2-py3-none-any.whl
在已存在的环境运行深度学习算法,报keras错误,可以重新安装python3.6.15+,然后软链接链接到/usr/bin/pythonxxx,然后pipxxx安装需要的包。
如果想指定特定python环境中的pyinstaller包打包项目:
注意:完全退出虚拟环境
python_xxx -m PyInstaller my_script.py
缺少c解释器和zlib
# 安装gcc
apt install build-essential
# 安装zlib
apt-get install zlib1g-dev