CentOS 7下安装Python3.5

最近用php做爬虫做到怀疑人生,所以想学学python,从网上找到一个安装教程,照着安装了一下,顺便也记录一下,以便以后用。

•安装python3.5可能使用的依赖

yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel

CentOS 7安装Python3.5

•到python官网找到下载路径, 用wget下载

wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz

CentOS 7安装Python3.5

•解压tgz包

tar -zxvf Python-3.5.1.tgz

CentOS 7安装Python3.5

•把python移到/usr/local下面

mv Python-3.5.1 /usr/local

•删除旧版本的python依赖

ll /usr/bin | grep python

rm -rf /usr/bin/python

CentOS 7安装Python3.5

•进入python目录

cd /usr/local/Python-3.5.1/

•配置

./configure

CentOS 7安装Python3.5

•编译 make

make

CentOS 7安装Python3.5

•编译,安装

make install

CentOS 7安装Python3.5

•删除旧的软链接,创建新的软链接到最新的python

rm -rf /usr/bin/python

ln -s /usr/local/bin/python3.5 /usr/bin/python

python -V

CentOS 7安装Python3.5

Enjoy your Python!

 

阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页