深度学习整理篇(三)CentOS 7.8中python 3.7与python 2.7同时存在说明

今天心血来潮,Virtual Box安装了CentOS 7.8 最新min版,安装完后,除了设置最新的网卡设置外,

vi /etc/sysconfig/network-scripts/ifcfg-e***根据你的网卡类型,修改ONBOOT=yes

使用yum install net-tools,

剩下的就是卸载python2.7了,结果一卸载就知道掉坑了,请看这篇文章描述

坑-centOS7.2--》重装 python2.7和yum!(原因误删了python后,yum不能用了)

https://www.cnblogs.com/mjbenkyo/p/12556255.html

按照上面的文章操作,还不能重新安装CentOS7.8。为了python2和python3共存,发现可以使用python和python3共存,Python3安装步骤(使用sudo 到root安装)

安装过程如下

--------------------------------------------------------------------------------------------------------------------------------------------------------------

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
下载并解压安装包
cd 你自己的目录
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.8.tar.xz
tar -xvJf  Python-3.7.8.tar.xz
编译及安装
mkdir /usr/local/python3 #创建编译安装目录
cd Python-3.7.8
./configure --prefix=/usr/local/python3
make && make install
创建软连接
ln -s /usr/local/python3/bin/python3 /usr/local/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip3
验证

python3 -V
pip3 -V

--------------------------------------------------------------------------------------------------------------------------------------------------------------

 

 

你可能感兴趣的:(深度学习)