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

  1. import sys
  2. sys.version_info

You should get the following response.

  1. 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. 对Java的常用对象(POJO、DTO、PO、BO、VO、DAO)详细解释及应用场景

    首先这些对象都应用都是一些单词的简称,也是一种应用思想,故其他语言也可以使用,在Java里比较常见这些对象吧.下面来一一解释. 一.POJO(Plain Ordinary Java Object). ...

  2. Xcode 8 的 Debug 新特性 —- WWDC 2016 Session 410 & 412 学习笔记

    Contents OverView Static Analyzer Localizability Instance Cleanup Nullablility Runtime Issue View De ...

  3. java 记录一下socket的server与client

    package com.test.server; import java.io.IOException; import java.net.ServerSocket; import org.apache ...

  4. Redis学习之路(002)- Ubuntu下redis开放端口

    Redis在ubuntu安装后默认是只有本地访问,需要别的ip访问我们需要修改redis的配置文件 1. dpkg -L redis-server 这命令我们可以看到redis的安装的文件在那些目录 ...

  5. 【C#】浅析C#中的日期处理

    1.字符串转化为日期 1.1第一种方式 使用 Convert.toDateTime 方法,该方法有很多重载方法,这里笔者就介绍两个常用的重载方法. 第一种: 使用: Convert.ToDateTim ...

  6. linux系统yum方式安装htop命令[转]

    CentOS下为yum加入rpmForge源,使用yum安装htop 为CentOS增加rpmForge软件源 wget http://pkgs.repoforge.org/rpmforge-rele ...

  7. MVC+Spring.NET+NHibernate .NET SSH框架整合 C# 委托异步 和 async /await 两种实现的异步 如何消除点击按钮时周围出现的白线? Linq中 AsQueryable(), AsEnumerable()和ToList()的区别和用法

    MVC+Spring.NET+NHibernate .NET SSH框架整合   在JAVA中,SSH框架可谓是无人不晓,就和.NET中的MVC框架一样普及.作为一个初学者,可以感受到.NET出了MV ...

  8. struts系列:校验(一)XML校验和函数方法校验

    一.jsp示例 <form action="login" method="post"> <div class="form-group ...

  9. webpack 4.0的一些小坑

    一.需要指定开发模式还是生产模式,需要改动两个地方: 1.package.json 中加入 --mode development "scripts": { "dev&qu ...

  10. 简简单单搞掂恼人的Laravel 5安装

    想折腾下Laravel 5了.Laravel是这世界上最好且没有之一的语言──PHP──的众多框架中的一个,是我比较感兴趣的PHP Web Framework. 但是安装Laravel可不是件容易的事 ...