安装python3

安装环境:yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-develreadline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel sqlite-devel
下载安装包:wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz
解压:tar -zxvf Python-3.6.1.tgz
cd Python-3.6.1
1.创建目录:mkdir -p /usr/local/python3
2.指定安装路径进行安装:./configure --prefix=/usr/local/python3
如果出现错误:configure: error: no acceptable C compiler found in $PATH
原因:缺少gcc编译环境
解决:yum install -y gcc
3.编译安装:make && make install
4.创建软链接:
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

 

参考博客:https://www.cnblogs.com/students/p/9535442.html

 

posted on 2020-11-02 15:38  渐行渐远的那些人  阅读(74)  评论(0编辑  收藏  举报