Centos 安装pyenv环境

前端之家收集整理的这篇文章主要介绍了Centos 安装pyenv环境前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。


env:
os Centos 7.3 x64

安装pyenv及pyenv插件pyenv-virtualenv

  1. git clone https://github.com/pyenv/pyenv.git /opt/pyenv
  2. git clone https://github.com/pyenv/pyenv-virtualenv.git /opt/pyenv/plugins/pyenv-virtualenv

设置环境变量

#cat /etc/profile.d/pyenv.sh

  1. export PYENV_ROOT="/opt/pyenv"
  2. export PATH="$PYENV_ROOT/bin:$PATH"
  3. eval "$(pyenv init -)"
  4. eval "$(pyenv virtualenv-init -)"

使环境变量生效

source /etc/profile.d/pyenv.sh

安装python需要的系统包

  1. yum install readline readline-devel readline-static -y
  2. yum install openssl openssl-devel openssl-static -y
  3. yum install sqlite-devel -y
  4. yum install bzip2-devel bzip2-libs -y

安装完毕

执行 pyenv versions测试
pyenv --help

猜你在找的CentOS相关文章