本想使用yum或者apt-get安装,看了看安装步骤,比安装包安装还麻烦,
遂采用安装包安装Python。
- Python官网下载个安装包:Python-3.6.5.tgz
- 上传到Linux服务器
- 解压
tar -zxvf Python-3.6.5.tgz
- 创建个文件夹,作为安装目录
mkdir /usr/local/soft/python-ins-3.6.5
- 进入解压后的目录
cd Python-3.6.5
- 初始化配置
./configure --prefix=/usr/local/soft/python-ins-3.6.5
- 编译
make
- 安装
make install
- 查看安装
python3 -V -bash: python3: command not found
- 配置环境变量,不同的系统可能会有所差别
-
vi /etc/profile
- 在 export PATH 之前加上:
PATH=/usr/local/soft/python-ins-3.6.5/bin:$PATH
- 重新加载配置:
source /etc/profile
-
-
测试安装状态
python3 -V Python 3.6.5