树莓派将python2升级为python3
新购买的树莓派3b+内置的python版本还是2.7,如果需要python3,则需要升级。
1.安装python3
pip install python3
2.卸载python2(可选)
sudo apt remove python
清除python2依赖
sudo apt autoremove
3.删除掉原先 python 的链接
sudo rm /usr/bin/python
4.创建一个新的链接指向刚刚安装的 python3.5
sudo ln -s /usr/bin/python3.5 /usr/bin/python
5.测试,输入python
Python 3.5.3 (default, Jan 19 2017, 14:11:04)
[GCC 6.3.0 20170124] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>>