pyenv,轻松切换各种python版本
pyenv,轻松切换各种python版本
解决什么问题
- mac自带python2,md又不能删掉他
- linux也自带python2,这玩意都过时了,也不赶紧换掉
安装pyenv
git 安装
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
bash 环境,就依次执行如下命令:
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
zsh?环境,就依次执行如下命令:
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
等个5分钟,让子弹飞一会,返回如下
? ~ pyenv install 3.7.3 pyenv: /Users/cuifuan/.pyenv/versions/3.7.3 already exists continue with installation? (y/N) y python-build: use 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
查看系统现在的python版本
? ~ pyenv versions system * 3.7.3 (set by /Users/cuifuan/.pyenv/version)
完成.
持续更新地址
https://www.yuque.com/ekko/python/fukahb
异常
zsh: command not found: wget
brew install wget ## 假如是centos yum install wget ## ubuntu apt-get install wget
相关推荐
liusarazhang 2020-05-30
chenhy 2020-05-25
Charliewolf 2020-05-01
zfyaixue 2020-04-14
sunny0 2020-03-03
yogoma 2020-03-01
明天你好 2020-02-20
ZeroKing 2020-02-09
MAC2007 2020-02-03
adc00 2020-01-24
阿艾辣悟叩德 2020-01-19
学习备忘录 2019-12-27
猛禽的编程艺术 2019-12-21
CloudXli 2019-12-20
Winterto0 2019-12-14
小方哥哥 2019-11-18
huang00 2019-11-11
小小天下飞 2019-11-10