User Tools

Site Tools


pyenv

pyenv安装

Ubuntu环境下pyenv安装

sudo apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git
curl https://pyenv.run | bash
# 安装后将以下内容加入~/.bashrc
export PATH="/home/<username>/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
# 安装后创建脚本pyenvinstall.sh,内容如下
v=$1
wget http://mirrors.sohu.com/python/$v/Python-$v.tar.xz -P ~/.pyenv/cache/
# 备用地址https://mirrors.huaweicloud.com/python/$v/Python-$v.tar.xz
pyenv install $v
# 然后执行bash pyenvinstall.sh <version>
pyenv.txt · Last modified: 2023/03/08 16:09 by xujianglong