- 安装编译以及相关的工具
- yum -y groupinstall “Development Tools”
# yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel xz-devel
# yum install libffi-devel -y - https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz
(下载龟速的话可以先下载好然后通过ftp上传)
# tar -xvJf Python-3.7.3.tar.xz
# ./configure #prefix=/usr/local/python3
# make && make install">wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz
(下载龟速的话可以先下载好然后通过ftp上传)
# tar -xvJf Python-3.7.3.tar.xz
# ./configure #prefix=/usr/local/python3
# make && make install - mkdir ~/python_envs
#cd ~/python_envs - python3 -m venv env_name
注:需要使用 python3 ,代表python3.7.3版本 - source ~/work/python_envs/env_name/bin/activate
- deactivate
安装编译以及相关的工具
yum -y groupinstall “Development Tools”
# yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel xz-devel
# yum install libffi-devel -y
下载安装Python
wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz
(下载龟速的话可以先下载好然后通过ftp上传)
# tar -xvJf Python-3.7.3.tar.xz
# ./configure #prefix=/usr/local/python3
# make && make install
到此python3.7.3 就安装完成了,此时系统里有两个python版本(自带3.6.8),软连接python3是(3.7.3),python(3.6.8)