【Python】pyenv 安装方式

1.git安装

yum install -y git

2.安装python编译依赖

yum install -y gcc make path gdbm-devel openssl-devel sqlite-devel readline-devel zlib-devel bzip2-devel

3.创建用户python

useradd python

4.登录用户python后安装pyenv

curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash

注意:1.如果出现curl: (35) SSL connect error的原因是nss版本过低,用yum -y update nss更新一下就可以了

yum -y update nss

紧接着继续curl安装如果出现这样的提示:WARNING: seems you still have not added 'pyenv' to the load path.

就把绿框中的加到bash 文件中:

export PATH="/home/python/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

然后再source一下即可

source ~/.bash_profile


请使用浏览器的分享功能分享到微信等