转自: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. ios中layoutsubview何时被调用

    layoutsubview和viewDidlayoutsubview(控制器)被调用的集中情况 一:当view的frame或bounds发生改变 1:直接改view的frame或bounds 会调用v ...

  2. maven中跳过单元测试

    Maven 提供了跳过单元测试的能力,只需要使用 Surefire 插件的 skip 参数. 在命令行,只要简单的给任何目标添加 maven.test.skip 属性就能跳过测试: $ mvn ins ...

  3. 利用Apache配置http expires值提高网站性能

    HTTP头中有个expires参数,设置一个未来的时间,在这时间以前,浏览器会先从cache读取,如果没有再从服务器中读取.对于像图片,css,script等静态内容,只需发一次http reques ...

  4. MongoDB学习笔记(6)--find

    MongoDB 查询文档 MongoDB 查询文档使用 find() 方法. find() 方法以非结构化的方式来显示所有文档. 语法 MongoDB 查询数据的语法格式如下: db.collecti ...

  5. 当 Swoole 遇上 ThinkPHP5 世界你好

    本文假设你已经有了 Linux 操作系统的 PHP 环境,强烈推荐使用 Vagrant 来搭建开发环境 安装 Swoole PECL 拓展 可以通过 pecl 命令或者通过源码包编译安装,本文采用 p ...

  6. Android_Bitmap_图片的二次采样并生成缩略图

    1.Bitmap概述 Android系统支持几种图片(.png (preferred), .jpg (acceptable), .gif (discouraged)), 其中Bitmap位图#ffff ...

  7. GANS 资料

    https://blog.csdn.net/a312863063/article/details/83512870 目 录第一章 初步了解GANs 3 1. 生成模型与判别模型. 3 2. 对抗网络思 ...

  8. Sql 查询当天、本周、本月记录

    --查询当天: select * from info where DateDiff(dd,datetime,getdate())=0 --查询24小时内的: select * from info wh ...

  9. ubuntu14.4.4安装smb服务实现文件共享

    1.软件安装,ubuntu14需要安装的软件有3个 安装服务前养成习惯 sudo apt-get upgrade 首先切换到超级用户  su - root sudo apt-get install s ...

  10. JAXB--@XmlType注解标注xml生成顺序

    默认情况下,Jaxb编组出来的xml中的字段顺序是随机的,你可以使用@XmlType的propOrder属性 来指定序列化的顺序.   第一步:定义java类时,使用@XmlType(propOrde ...