CentOS7.4默认安装了Python 2.7.5,可以使用python -V查看。记录一下安装CentOS7.4下安装Python3.5。1). 安装相关包yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-deve...
CentOS7.4默认安装了Python 2.7.5,可以使用python -V查看。
记录一下安装CentOS7.4下安装Python3.5。
1). 安装相关包
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make
2).下载Python3.5.4源码包
wget https://www.python.org/ftp/python/3.5.4/Python-3.5.4.tar.xz
3).编译安装
tar xf Python-3.5.4.tar.xz -C /usr/local/src/
cd /usr/local/src/Python-3.5.4
./configure --prefix=/usr/local/python3
make && make install
4).更新pip
/usr/local/python3/bin/pip3 install --upgrade pip
/usr/local/python3/bin/pip3 list
5).备份python2.7
cd /usr/bin/
mv python python.bak
6).创建软连
ln -s /usr/local/python3/bin/python3 /usr/bin/python
7).查看版本
python -V
8).修改yum配置文件
vim /usr/bin/yum
#!/usr/bin/python2.7
vim /usr/libexec/urlgrabber-ext-down
#! /usr/bin/python2.7
CentOS7.4 安装Python3.5
http://blog.zhengdingzx.com/26.html
沃梦达教程
本文标题为:CentOS7.4 安装Python3.5
猜你喜欢
- CentOS7 安装 Python3.6 2023-09-04
- Python之路-Python中的线程与进程 2023-09-04
- python中列表添加元素的几种方式(+、append()、ext 2022-09-02
- python线程池ThreadPoolExecutor与进程池ProcessPoolExecutor 2023-09-04
- 在centos6.4下安装python3.5 2023-09-04
- Python实现将DNA序列存储为tfr文件并读取流程介绍 2022-10-20
- windows安装python2.7.12和pycharm2018教程 2023-09-03
- python中defaultdict用法实例详解 2022-10-20
- Python 保存数据的方法(4种方法) 2023-09-04
- Python Pandas如何获取和修改任意位置的值(at,iat,loc,iloc) 2023-08-04