官网https://github.com/pyenv/pyenv
Visit my other project: https://github.com/pyenv/pyenv-installer
yum -y install git
yum -y install gcc make patch gdbm-devel openssl-devel sqlite-devel readline-devel zlib-devel bzip-devel
https://files.cnblogs.com/files/zoer/pyenv-install.sh
vi /etc/profile 或者家目录下.bashrc
增加
export PATH="/root/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
在当前bash生效
exec $SHELL
pyenv install --list
查看python的所有版本
pyenv install 3.6.9
安装python3.6.9版本
pyenv update
更新--list库中的版本
pyenv version
查看当前python版本
pyenv versions
查看pyenv可管理版本
pyenv virtualenv 3.6.9 pyenv3.6.9
创建一个版本别名
mkdir web369
创建一个用于369版本的目录
pyenv local pyenv3.6.9
创建虚拟版本目录
mkdir ~/.pip
cat > ~/.pip/pip.conf <<EOF
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
EOF
pip install jupyter
pip freeze > /python/requirements
导出当前环境的安装包及版本
pip install -r /python/requirements
安装上一个环境的包,保证两个环境一致
jupyter password
设置登录密码
jupyter notebook --ip=0.0.0.0 --port=8888 --allow-root &
浏览器访问 http://localtion:8888
原文:https://www.cnblogs.com/zoer/p/13124968.html