欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Centos7配置Python3开发环境

程序员文章站 2022-06-11 13:03:33
...
# 解决依赖
yum install vim wget.x86_64 gcc.x86_64 gcc-c++.x86_64 zlib-devel.x86_64 bzip2.x86_64 bzip2-devel.x86_64 openssl-devel.x86_64 sqlite-devel.x86_64 libffi-devel.x86_64 ncurses-devel.x86_64 readline-devel.x86_64 tk-devel.x86_64 make.x86_64 -y

# 下载Python3
wget https://www.python.org/ftp/python/3.8.6/Python-3.8.6.tgz

# 编译安装
tar -xf Python-3.8.6.tgz && cd Python-3.8.6/
./configure --prefix=/opt/python3.8
make && make install

# 配置环境变量
vim ~/.bash_profile

PY3_HOME=/opt/python3.8
PATH=$PATH:$HOME/bin:$PY3_HOME/bin

source ~/.bash_profile

# 检查版本
python3 -V

# 配置pipenv
pip3 install pipenv

# 更新pip
pip3 install --upgrade pip