关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻公共列表

linux python升级并设置全局使用

发布时间:2020/2/11 16:44:20
香港云服务器

1.安装依赖包
sudo yum install -y zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel \
openssl-devel xz xz-devel libffi-devel gcc readline readline-devel readline-static \
openssl openssl-devel openssl-static sqlite-devel bzip2-devel bzip2-libs
2.安装git
yum install git -y
3.安装pyenv
curl -L https://github.com/pyenv/pyenv-i ... bin/pyenv-installer | bash
4..添加环境变量到.bashrc
cat >> ~/.bashrc << EOF
export PATH="/root/.pyenv/bin:\$PATH"
eval "\$(pyenv init -)"
eval "\$(pyenv virtualenv-init -)"
EOF
source ~/.bashrc
5..用pyenv安装并启用python
pyenv install 3.7.1
pyenv global 3.7.1