https://gist.github.com/BMeu/af107b1f3d7cf1a2507c9c6429367a3b

Installing Python 3.5 on Raspbian

As of October 2016, Raspbian does not yet include the latest Python release, Python 3.5. This means we will have to build it ourselves, and here is how to do it.

  1. Install the required build-tools (some might already be installed on your system).

    $ sudo apt-get update
    $ sudo apt-get install build-essential tk-dev
    $ sudo apt-get install libncurses5-dev libncursesw5-dev libreadline6-dev
    $ sudo apt-get install libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev
    $ sudo apt-get install libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev

    If one of the packages cannot be found, try a newer version number (e.g. libdb5.4-dev instead of libdb5.3-dev).

  2. Download and install Python 3.5. When downloading the source code, select the most recent release of Python 3.5, available on the official site. Adjust the file names accordingly.

    $ wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz
    $ tar zxvf Python-3.5.2.tgz
    $ cd Python-3.5.2
    $ ./configure --prefix=/usr/local/opt/python-3.5.2
    $ make
    $ sudo make install
  3. Make the compiled binaries globally available.

    $ sudo ln -s /usr/local/opt/python-3.5.2/bin/pydoc3.5 /usr/bin/pydoc3.5
    $ sudo ln -s /usr/local/opt/python-3.5.2/bin/python3.5 /usr/bin/python3.5
    $ sudo ln -s /usr/local/opt/python-3.5.2/bin/python3.5m /usr/bin/python3.5m
    $ sudo ln -s /usr/local/opt/python-3.5.2/bin/pyvenv-3.5 /usr/bin/pyvenv-3.5
    $ sudo ln -s /usr/local/opt/python-3.5.2/bin/pip3.5 /usr/bin/pip3.5

    You should now have a fully working Python 3.5 installation on your Raspberry Pi!

  4. Optionally: Delete the source code and uninstall the previously installed packages. When uninstalling the packages, make sure you only remove those that were not previously installed on your system. Also, remember to adjust version numbers if necesarry.

    $ sudo rm -r Python-3.5.2
    $ rm Python-3.5.2.tgz
    $ sudo apt-get --purge remove build-essential tk-dev
    $ sudo apt-get --purge remove libncurses5-dev libncursesw5-dev libreadline6-dev
    $ sudo apt-get --purge remove libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev
    $ sudo apt-get --purge remove libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev
    $ sudo apt-get autoremove
    $ sudo apt-get clean

This guide is pretty much taken from the following tutorial: https://liudr.wordpress.com/2016/02/04/install-python-on-raspberry-pi-or-debian/

 

dschep commented on 9 Jan 2017 •

edited 

I've forked and updated this for Python 3.6 (and use make altinstall and the default prefix) here: https://gist.github.com/dschep/24aa61672a2092246eaca2824400d37f

 

petonic commented on 23 May 2017

In step 2, for the first make command, use make -j 4 instead. This directs make to use 4 threads instead of being single threaded. It will reduce the build time significantly.

树莓派安装python3.5的更多相关文章

  1. 树莓派上编译安装python3.6

    1.更新树莓派系统 sudo apt-get update sudo apt-get upgrade -y 2.安装python依赖环境 sudo apt-get install build-esse ...

  2. centos6安装python3.4和pip3

    在安装了epel源的情况下,直接yum就可以安装python3.4 yum install python34 -ypython3 --version 没有自带pip3,从官网安装 wget --no- ...

  3. 在CentOS6.8上面安装Python3.5

    以前每次装Linux,升级Python,都会一堆问题,然后Google,本来想着记录一下,结果问题太多了,也就记不住了,这次特地记了下来. 在CentOS6.8上面安装Python3.5我的系统是Ce ...

  4. python3.5学习笔记:linux6.4 安装python3 pip setuptools

    前言: python3应该是python的趋势所在,当然目前争议也比较大,这篇随笔的主要目的是记录在linux6.4下搭建python3环境的过程 以及碰到的问题和解决过程. 另外,如果本机安装了py ...

  5. 在Ubuntu中安装Python3

    首先,通过命令行安装Python3.2,只需要在终端中通过命令行安装即可: sudo apt-get install python3   一路yes. 因为Ubuntu很多底层采用的是Python2. ...

  6. python环境搭建-在Windows上安装python3.5.2

    在Windows上安装Python3.5.2 首先,根据你的Windows版本(64位还是32位)从Python的官方网站下载Python 3.5.2对应的64位安装程序或32位安装程序(网速慢的同学 ...

  7. Ubuntu下安装Python3.4

    转自:http://blog.sina.com.cn/s/blog_7cdaf8b60102vf2b.html 1. 通过命令行安装Python3.4,执行命令:sudo apt-get instal ...

  8. Vmvare下Ubuntu安装Python3.4

    Ubuntu14.4下默认安装的Python版本是2.7.随着Python3.4的使用,现在大部分Python开发者都喜欢使用Py3.4.那么Ubuntu下应该怎么安装Python3.4呢? (1). ...

  9. CentOS 6 安装 Python3.5以及配置Django

    http://www.jianshu.com/p/6199b5c26725 文/FiveStrong(简书作者)原文链接:http://www.jianshu.com/p/6199b5c26725著作 ...

随机推荐

  1. 433. Number of Islands【LintCode java】

    Description Given a boolean 2D matrix, 0 is represented as the sea, 1 is represented as the island. ...

  2. mysql先删除后插入导致死锁

    所报的错误为:pymysql.err.OperationalError: (1213, 'Deadlock found when trying to get lock; try restarting ...

  3. DX孟虎点评新兴市场:巴西俄罗斯火爆背后

    [亿邦动力网讯]4月3日消息,在第九届中国中小企业电子商务大会暨2014中国(河南)跨境贸易电子商务峰会上,DX公司CEO孟虎对新兴市场做了详细的分析,指出在当今的跨境电商环境下,北美.西欧作为电商成 ...

  4. 带你玩转JavaScript中的隐式强制类型转换

    正题开始前我想先抛出一个问题,==和===有什么区别?可能一般人会想,不就是后者除了比较值相等之外还会比较类型是否相等嘛,有什么好问的,谁不知道?!但是这样说还不够准确,两者的真正区别其实是==在比较 ...

  5. Beta冲刺第二周王者荣耀交流协会第四次会议

    1.例会照片: 成员:王超,高远博,冉华,王磊,王玉玲,任思佳,袁玥全部到齐. master:王玉玲 2.时间跨度: 2017年11月20日 18:00 — 18:13,总计13分钟. 3.地点: 一 ...

  6. 上午做的第一个安卓app

    刚开始学习安卓开发,有好多不懂,好多快捷键不知道,好多文件也不知道是干什么用的,初学时的确会有很多烦恼,比如哪里又多一个空格也会报错,有时候错误很难看懂. 嘿嘿,一上午的功夫边学习边调代码,做出了我第 ...

  7. 机器学习实战第二章----KNN

    tile的使用方法 tile(A,n)的功能是把A数组重复n次(可以在列方向,也可以在行方向) argsort()函数 argsort()函数返回的是数组中值从大到小的索引值 dict.get()函数 ...

  8. 第二次c艹作业

    1,c语言实现方法:按照电梯运行方式,改变被定义为全局变量的结构体的数值. c艹实现方法:用类来存放电梯的属性,整个过程都是对类操作. 两者不同:c语言是面向过程的,整个函数里都要对电梯的参数进行修改 ...

  9. 扩展欧几里德 SGU 106

    题目链接:http://acm.sgu.ru/problem.php?contest=0&problem=106   题意:求ax + by + c = 0在[x1, x2], [y1, y2 ...

  10. lintcode-433-岛屿的个数

    433-岛屿的个数 给一个01矩阵,求不同的岛屿的个数. 0代表海,1代表岛,如果两个1相邻,那么这两个1属于同一个岛.我们只考虑上下左右为相邻. 样例 在矩阵: [ [1, 1, 0, 0, 0], ...