轉自:https://www.reddit.com/r/IPython/comments/3lf81w/using_python35_in_ubuntu_trusty/
Note:照這個方案安裝python3.5後,不少系統程序用不了了。。由於系統程序用的3.4,因此只能還原系統python版本了:
$ sudo rm /usr/bin/python3
$ sudo mv /usr/bin/python3-old /usr/bin/python3
$ wget https://bootstrap.pypa.io/get-pip.py
$ sudo python3 get-pip.py
$ sudo python get-pip.py
$ sudo pip3 install --upgrade ipython[all]
$ sudo pip install --upgrade ipython[all]
$ sudo rm -rf /usr/local/bin/ipython
$ sudo ln -s /usr/local/bin/ipython2 /usr/local/bin/ipython
# 驗證:
$ python --version
$ python3 --version
$ python3.5 --version
$ pip --version
$ pip3 --version
$ ipython
$ ipython3python
If you haven't already made the switch by installing from the source, and you want to install Python 3.5 system wide, you can use the following steps to upgrade to Python using the fkrull/deadsnakes ppa.json
Open a terminal window.bootstrap
After your done you can check by creating a Python 3.5 kernel Notebook and entering the following:ubuntu
import sys sys.version_info
You should get the following response.ide
sys.version_info(major=3, minor=5, micro=0, releaselevel='final', serial=0)
*Edit: Reverted the default python3 to python3.4 but created a python3.5 kernel entry for the notebook. The reason for this is that changing the default python3 to python3.5 broke the apt-get updating process.this