关于ubuntu中python解释器的一些总结

1.查看python解释器的位置 

先进入python

import sys

sys.executable

2.查看python版本

python2 --version

python3 --version

3.查看python指向哪个解释器并修改

python --version

若想把python解释器从python2变成python3,则

echo alias python=python3 >> ~/.bashrc

source ~/.bashrc

再查看一下是否奏效,则

python --version

猜你喜欢

转载自blog.csdn.net/qq_40807311/article/details/85372131
今日推荐