pyenv,轻松切换各种python版本
2021-01-17 22:11
标签:already 地址 The command pat href 环境 bash ash git 安装 bash 环境,就依次执行如下命令: zsh?环境,就依次执行如下命令: 等个5分钟,让子弹飞一会,返回如下 查看系统现在的python版本 完成. https://www.yuque.com/ekko/python/fukahb zsh: command not found: wget pyenv,轻松切换各种python版本 标签:already 地址 The command pat href 环境 bash ash 原文地址:https://www.cnblogs.com/cvandy/p/12916465.htmlpyenv,轻松切换各种python版本
解决什么问题
安装pyenv
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
echo ‘export PYENV_ROOT="$HOME/.pyenv"‘ >> ~/.bashrc
echo ‘export PATH="$PYENV_ROOT/bin:$PATH"‘ >> ~/.bashrc
echo -e ‘if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi‘ >> ~/.bashrc
echo ‘export PYENV_ROOT="$HOME/.pyenv"‘ >> ~/.zshrc
echo ‘export PATH="$PYENV_ROOT/bin:$PATH"‘ >> ~/.zshrc
echo -e ‘if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi‘ >> ~/.zshrc
查看版本
? ~ pyenv versions
system
* 3.7.3 (set by /Users/cuifuan/.pyenv/version)
切换版本
# 国内源
wget http://mirrors.sohu.com/python/3.7.3/Python-3.7.3.tar.xz -P ~/.pyenv/cache
# 安装
pyenv install 3.7.3
? ~ pyenv install 3.7.3
pyenv: /Users/cuifuan/.pyenv/versions/3.7.3 already exists
continue with installation? (y/N) y
python-build: use openssl@1.1 from homebrew
Installing readline-8.0...
Installed readline-8.0 to /Users/xxx/.pyenv/versions/3.7.3
Installing Python-3.7.3...
python-build: use zlib from xcode sdk
Installed Python-3.7.3 to /Users/xxx/.pyenv/versions/3.7.3
? ~ pyenv versions
system
* 3.7.3 (set by /Users/cuifuan/.pyenv/version)
持续更新地址
异常
brew install wget
## 假如是centos
yum install wget
## ubuntu
apt-get install wget
上一篇:C# lazy延迟加载
下一篇:js常用方法(1)-----数组
文章标题:pyenv,轻松切换各种python版本
文章链接:http://soscw.com/index.php/essay/43375.html