前面都是按照网上的教程配置的,简略步骤如下:
which python3
/usr/bin/python3
vim ~/.bash_profile
alias python="/usr/bin/python3"
source ~/.bash_profile
python -V
Python 3.8.2
切换用户,再次回到该用户下
python -V
Python 2.7
新增并编辑 ~/.zshrc
source ~/.bash_profile
保存
再次切换用户/重新开终端
发现~/.zshrc没生效,版本还是2.7
最后发现是当前系统默认的SHELL版本是
echo $SHELL
/bin/sh
此时~/.zshrc没有作用,需要切换为zsh,命令如下:
1.查看当前系统装了哪些shell
cat /etc/shells2.当前正在运行的shell版本
echo $SHELL3.切换zsh
chsh -s /bin/zsh
切换后 ~/.zshrc生效
重启终端/切换用户后
python -V
Python 3.8.2
浅浅记录一下