转自: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
$ ipython3


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.

Open a terminal window.

  • install Personal Package Archive: ppa:fkrull/deadsnakes

    • sudo add-apt-repository ppa:fkrull/deadsnakes
    • sudo apt-get update
  • install the following packages:
    • sudo apt-get install python3.5
    • sudo apt-get install python3.5-dev
    • sudo apt-get install libncurses5-dev
  • change python3 link to point to python3.5 instead of python3.4 (/usr/bin/)
    • sudo mv /usr/bin/python3 /usr/bin/python3-old
    • sudo ln -s /usr/bin/python3.5 /usr/bin/python3
  • install pip from https://pip.pypa.io/en/stable/installing/
  • install the following with pip3:
    • sudo pip3 install setuptools --upgrade
    • sudo pip3 install ipython[all]
  • change the python3 link back
    • sudo rm /usr/bin/python3
    • sudo mv /usr/bin/python3-old /usr/bin/python3
  • create python3.5 kernel
    • cp -R ~/.ipython/kernels/python3 ~/.ipython/kernels/python3.5
    • sed -i -- 's/3/3.5/g' ~/.ipython/kernels/python3.5/kernel.json

After your done you can check by creating a Python 3.5 kernel Notebook and entering the following:

import sys
sys.version_info

You should get the following response.

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.

(转)Using Python3.5 in Ubuntu - Trusty的更多相关文章

  1. 在Ubuntu Trusty 14.04 (LTS) (64-bit)安装Docker

    Ubuntu Trusty带来的是3.13.0 Linux kernel ,需要准备所有ubuntu库的某些条件,docker安装包被称之为docker.io.(注:Ubuntu (和Debian)包 ...

  2. 初始化 Ubuntu Trusty 14.04

    1. 软件源 sudo vim /etc/apt/source.list # 将软件源改为 sohu 的 deb http://mirrors.sohu.com/ubuntu/ trusty main ...

  3. jupyter notebook下python2和python3共存(Ubuntu)

    提示NOTICE 时间:2018/04/06 主题:Ubuntu 下CAFFE框架 主角:Jupyter Notebook 简介: Jupyter Notebook(此前被称为 IPython not ...

  4. 吴恩达深度学习第4课第3周编程作业 + PIL + Python3 + Anaconda环境 + Ubuntu + 导入PIL报错的解决

    问题描述: 做吴恩达深度学习第4课第3周编程作业时导入PIL包报错. 我的环境: 已经安装了Tensorflow GPU 版本 Python3 Anaconda 解决办法: 安装pillow模块,而不 ...

  5. 在ubuntu trusty下安装python的rasterio库

    就这些吧.. apt-get update -y apt-get install -y software-properties-common add-apt-repository ppa:ubuntu ...

  6. [Linux] Ubuntu Server18 python3.7 虚拟环境

    Ubuntu Server18 python3.7 环境 Ubuntu Server18 默认是python3.6, 目前开发主要用python3.7. 所以想搭建python3.7环境. 试过几手动 ...

  7. ubuntu中安装python3和pip

    python3: 在ubuntu的包中,python的二代和三代版本的命名:二代:python,三代:python3 安装python3: sudo apt install python3 同理:pi ...

  8. Debian系列Linux/Ubuntu 安装软件

    wps(http://community.wps.cn/download/) 优客天气(https://launchpad.net/indicator-china-weather/+download) ...

  9. ubuntu 安装软件(apt源)

    最近使用docker 构建python3的环境: 进入容器发现 连个vi命令多没有... 1.安装一个呗: apt-get 报错:root@22f41d59e3b2:~# apt-get instal ...

随机推荐

  1. (原)ubuntu中安装tensorflow

    转载请注明出处: http://www.cnblogs.com/darkknightzh/p/6592052.html 参考网址: https://www.tensorflow.org/install ...

  2. 像python一样运行js的__main__

    在测试时,使用单文件进行简单测试既简洁又清晰.js其实也是可以做到的 if (require && require.main == module) { console.log(&quo ...

  3. 在压缩话单中过滤指定IP的一个小脚本

    工作需要,需要过滤出含有指定的IP段的话单,编写的脚本名字叫 filter.sh #!/bin/bash TARGET_PATH=/data/flume/flume_exec_log/Dst_for_ ...

  4. DPDK的安装与绑定网卡(转)

    from:http://www.cnblogs.com/mylinuxer/p/4274178.html DPDK的安装与绑定网卡 DPDK的安装有两种方法: 第一种是使用dpdk/tools/set ...

  5. SQL如何获得本季度第一天、一年的第一天、本月的最后一天

    nterval 参数,具有以下设定值: 设置 描述 Year yy, yyyy 年 quarter qq, q 季 Month mm, m 月 dayofyear dy, y 一年的日数 Day dd ...

  6. 《JAVA与模式》之备忘录模式

    一.备忘录(Memento)模式结构 备忘录对象是一个用来存储另外一个对象内部状态的快照(snapshot)的对象.备忘录模式的用意是在不破坏封装的条件下,将一个对象的状态捕捉住,并外部化,存储起来, ...

  7. tableView的用法具体解释

    1 tableView的类型   1.1 UITableViewStylePlain  没有区头 不显区头     向上滑动区头不会移动到屏幕外面 ' 1.2 UITableViewStyleGrou ...

  8. UI--仿IOS控件之ActionSheet样式 and more..

    ## <代码里的世界> -UI篇 用文字札记描绘自己 android学习之路 转载请保留出处 by Qiao http://blog.csdn.net/qiaoidea/article/d ...

  9. 查看Linux内核及发行商版本命令

    一.查看Linux内核版本命令(两种方法): 1. cat /proc/version Linux version -.el7.x86_64 (builder@kbuilder.dev.centos. ...

  10. Python 爬虫编码格式问题 gb2312转换utf8

    遇到的问题是:爬取网页得到的结果如下(部分)  里面的中文出现乱码. <!DOCTYPE html> <html lang='zh-CN'> <head> < ...