服务器(Ubuntu)更新python至3.7.4

服务器(Ubuntu)更新python至3.7.4

①下载python3.7.4包:

https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz

②解压文件并且进入解压后的文件夹
tar zxvf Python-3.7.4.tgz
cd Python-3.7.4
③编译
make

这一步可能会出现一个错误:

make: *** No targets specified and no makefile found. Stop.
没关系,可以输入这句代码进行化解:
./configure

④安装啦

make install
可能会出现的问题
zipimport.ZipImportError: can’t decompress data; zlib not available Makefile:1132: recipe for target
解决方案:
sudo apt-get install zlib1g-dev
ModuleNotFoundError: No module named '_ctypes’Makefile:1132: recipe for target ‘install’ failedmake: *** [install] Error 1
解决方案:

sudo apt-get install --reinstall zlibc zlib1g zlib1g-dev
sudo apt-get install libffi-dev libssl-dev libreadline-dev -y

你可能感兴趣的:(服务器(Ubuntu)更新python至3.7.4)