(转)Using Python3.5 in Ubuntu - Trusty
转自: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/
- wget https://bootstrap.pypa.io/get-pip.py
- sudo python3 get-pip.py
- 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的更多相关文章
- 在Ubuntu Trusty 14.04 (LTS) (64-bit)安装Docker
Ubuntu Trusty带来的是3.13.0 Linux kernel ,需要准备所有ubuntu库的某些条件,docker安装包被称之为docker.io.(注:Ubuntu (和Debian)包 ...
- 初始化 Ubuntu Trusty 14.04
1. 软件源 sudo vim /etc/apt/source.list # 将软件源改为 sohu 的 deb http://mirrors.sohu.com/ubuntu/ trusty main ...
- jupyter notebook下python2和python3共存(Ubuntu)
提示NOTICE 时间:2018/04/06 主题:Ubuntu 下CAFFE框架 主角:Jupyter Notebook 简介: Jupyter Notebook(此前被称为 IPython not ...
- 吴恩达深度学习第4课第3周编程作业 + PIL + Python3 + Anaconda环境 + Ubuntu + 导入PIL报错的解决
问题描述: 做吴恩达深度学习第4课第3周编程作业时导入PIL包报错. 我的环境: 已经安装了Tensorflow GPU 版本 Python3 Anaconda 解决办法: 安装pillow模块,而不 ...
- 在ubuntu trusty下安装python的rasterio库
就这些吧.. apt-get update -y apt-get install -y software-properties-common add-apt-repository ppa:ubuntu ...
- [Linux] Ubuntu Server18 python3.7 虚拟环境
Ubuntu Server18 python3.7 环境 Ubuntu Server18 默认是python3.6, 目前开发主要用python3.7. 所以想搭建python3.7环境. 试过几手动 ...
- ubuntu中安装python3和pip
python3: 在ubuntu的包中,python的二代和三代版本的命名:二代:python,三代:python3 安装python3: sudo apt install python3 同理:pi ...
- Debian系列Linux/Ubuntu 安装软件
wps(http://community.wps.cn/download/) 优客天气(https://launchpad.net/indicator-china-weather/+download) ...
- ubuntu 安装软件(apt源)
最近使用docker 构建python3的环境: 进入容器发现 连个vi命令多没有... 1.安装一个呗: apt-get 报错:root@22f41d59e3b2:~# apt-get instal ...
随机推荐
- Swift3 JSON字符串和字典互转(JSON字符串转字典和字典转JSON字符串)
直接上代码吧 1.JSONString转换为字典 /// JSONString转换为字典 /// /// - Parameter jsonString: <#jsonString descrip ...
- 大道至简的C语言内存管理
C语言内存的开辟和释放需要程序员自己来实现. 而C语言的内存开辟和释放只在stdlib.h里面提供了四个函数,这么简洁的设计就足以完成一切工作. C++里面各种类型的指针漫天飞舞,显得啰嗦冗余. ca ...
- build high performance server 转载
http://blog.ci123.com/wobushizhanghua/entry/246311 先后查看了haproxy,l7sw和lighttpd的 相关源码,无一例外,他们一致认为多路复用是 ...
- 老男孩linux实战培训初级班第二次课前考试题
################################################################ 本文内容摘录于老男孩linux实战运维培训中心课前考试题(答案部分) ...
- Linux 源代码在线(http://lxr.linux.no/linux/)。
LXR 是一个通用的源代码索引器和交叉引用器 它提供了一个基于 web 的可浏览任意定义以及任意标识的用法. 它支持很多种语言. LXR 曾经被作为 “Linux 交叉引用器” 但是已经被证明它可以用 ...
- windbg-.foreach循环输入(windbg script)
.foreach .foreach 关键字分析一个或多个命令的输出并将该输出中每一个值作为另一个或多个命令的输入 .foreach [Options] ( Variable { InCommands ...
- POJ 1637 Sightseeing tour (SAP | Dinic 混合欧拉图的判断)
Sightseeing tour Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 6448 Accepted: 2654 ...
- Oracle命令(二):Oracle数据库几种启动和关闭方式
一.Oracle数据库几种启动方式 1.startup nomount 非安装启动,这种方式下启动可执行:重建控制文件.重建数据库,读取init.ora文件,启动instance,即启动SGA和后台进 ...
- .Net Core ORM选择之路,哪个才适合你 通用查询类封装之Mongodb篇 Snowflake(雪花算法)的JavaScript实现 【开发记录】如何在B/S项目中使用中国天气的实时天气功能 【开发记录】微信小游戏开发入门——俄罗斯方块
.Net Core ORM选择之路,哪个才适合你 因为老板的一句话公司项目需要迁移到.Net Core ,但是以前同事用的ORM不支持.Net Core 开发过程也遇到了各种坑,插入条数多了也特别 ...
- c#之hello world
前言:公司开始转型java,作为javaer,负责其他同事转型,期间以为工作需要,需要简单学习c#语法,顾有此文,及其后续的一系列文章(c#里头的一些优点,可以为提升java的思想带来帮助) 1. 安 ...