Ubuntu 18.04 切换使用Python3
2020-12-13 15:51
标签:tps 安装 使用 文件 html ubuntu grep box 软链接 我安装的Ubuntu 默认的python是2.7.5 我参考网上照到的文章,如果需要默认python为 python3 python命令默认是 python 3 python命令默认是 python 2 Ubuntu 18.04 切换使用Python3 标签:tps 安装 使用 文件 html ubuntu grep box 软链接 原文地址:https://www.cnblogs.com/fsong/p/11616381.htmlpython -V
sudo cp /usr/bin/python /usr/bin/python_bak #备份默认的python文件
sudo rm /usr/bin/python #移除
sudo ln -s /usr/bin/python3 /usr/bin/python #使用软链接,
sudo cp /usr/bin/python /usr/bin/python_bak #备份默认的python文件
sudo rm /usr/bin/python #移除
sudo ln -s /usr/bin/python2 /usr/bin/python #使用软链接,
wa@wa-VirtualBox:/usr/bin$ ls -l|grep python
-rwxr-xr-x 1 root root 1056 4月 16 2018 dh_python2
lrwxrwxrwx 1 root root 23 7月 10 00:51 pdb2.7 -> ../lib/python2.7/pdb.py
lrwxrwxrwx 1 root root 23 8月 21 01:12 pdb3.6 -> ../lib/python3.6/pdb.py
lrwxrwxrwx 1 root root 31 10月 1 18:09 py3versions -> ../share/python3/py3versions.py
lrwxrwxrwx 1 root root 9 4月 16 2018 python -> python2.7
lrwxrwxrwx 1 root root 9 4月 16 2018 python2 -> python2.7
-rwxr-xr-x 1 root root 3633480 7月 10 00:51 python2.7
lrwxrwxrwx 1 root root 9 10月 1 18:09 python3 -> python3.6
-rwxr-xr-x 2 root root 4526456 8月 21 01:12 python3.6
-rwxr-xr-x 2 root root 4526456 8月 21 01:12 python3.6m
lrwxrwxrwx 1 root root 10 10月 1 18:09 python3m -> python3.6m
lrwxrwxrwx 1 root root 29 4月 16 2018 pyversions -> ../share/python/pyversions.py
References
上一篇:WPF Template
下一篇:实用API大全
文章标题:Ubuntu 18.04 切换使用Python3
文章链接:http://soscw.com/index.php/essay/35480.html