✸ ✸ ✸
1.下载安装包,这里是Python-3.7.3版本.
wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz
2.系统依赖库安装.
yum -y install gcc
yum -y install ncurses ncurses-devel
yum -y install zlib zlib-devel
yum -y install bzip2 bzip2-devel
yum -y install ncurses ncurses-devel
yum -y install readline readline-devel
yum -y install openssl openssl-devel
yum -y install openssl-static
yum -y install xz lzma xz-devel
yum -y install sqlite sqlite-devel
yum -y install gdbm gdbm-devel
yum -y install tk tk-devel
yum -y install libffi libffi-devel
3.解压,编译,安装,做软连,刷新动态库。
tar zxvf Python-3.7.3.tgz
cd Python-3.7.3/
./configure --prefix=/usr/python --enable-shared CFLAGS=-fPIC
make
make install
ln -s /usr/python/bin/python3 /usr/bin/python3
ln -s /usr/python/bin/pip3 /usr/bin/pip3
echo "/usr/python/lib" >> /etc/ld.so.conf
ldconfig
[root@wangzi Python-3.7.3]# python3 --version
Python 3.7.3
[root@wangzi Python-3.7.3]# pip3 --version
pip 19.0.3 from /usr/python/lib/python3.7/site-packages/pip (python 3.7)
✸ ✸ ✸
📜 版权声明
本文作者:王梓 | 原文链接:https://www.bthlt.com/note/11079567-Pythonpython3.7安装
出处:葫芦的运维日志 | 转载请注明出处并保留原文链接


📜 留言板
留言提交后需管理员审核通过才会显示