Python3安装

作者: Fizz_YF | 来源:发表于2019-12-31 14:59 被阅读0次

依赖安装:

yum -y groupinstall "Development tools"
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
yum install libffi-devel -y

下载链接https://www.python.org/downloads/source/

目前最新版本:wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tar.xz

编译安装:

./configure --prefix=/usr/local/python3
#./configure --prefix=/usr/local/python3 --enable-optimizations
make && make install

安装Python3时,会自动安装pip。假如没有,需要自己手动安装。

yum -y install python-pip

创建软链接:

ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

更新pip:

pip3 install --upgrade pip

安装扩展包:
解压后,

python setup.py install

相关文章

网友评论

    本文标题:Python3安装

    本文链接:https://www.haomeiwen.com/subject/hzwboctx.html