浏览量 4328
2017/05/02 22:41
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)
上一篇 搜索 下一篇