44

Python 3.6 just came out. I tried following these instructions to build from a tarball, but it got hung up on the make command, so I terminated the process after 20 minutes or so.

I also noticed that while the ./configure command was going, a number of the checks ended with "no's." Do I need to pick back through and install everything that did such?

Justin Palmer
  • 549
  • 1
  • 4
  • 3

6 Answers6

40

How do I update my RPi3 to Python 3.6?

As of today, only the installation from source is available. The instructions you referenced are correct for version 3.6. To repeat:

wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz
tar xzvf Python-3.6.0.tgz
cd Python-3.6.0/
./configure
make -j4
sudo make install

On a fresh Raspbian on Raspberry Pi 3 with a class 10 SD card (YMMV):

  • configure takes over 2 minutes
  • make takes about 15 minutes (it produces 8 warnings to the stderr)
  • sudo make install takes about 2 minutes

Do I need to pick back through and install everything that did such?

Unless configure script reports an error, the answer is: no, of course not.

configure performs a series of checks and uses the results as input to create the Makefile. The results depend on architecture, hardware features, etc. These are not requirements for the successful compilation. One of the first checks is a check for Python 3.6 itself, for which the result will certainly be no.

make -j4 simply uses all 4 rpi cores in the make process (much faster)

JxAxMxIxN
  • 103
  • 4
techraf
  • 4,353
  • 10
  • 32
  • 43
28

I highly recommend you check out the Berryconda package manager by jjhelmus. It is basically a more up-to-date version of the armv7l version of Miniconda, and has the Python 3.6 package available without needing to compile it from source.

Alternatively, if you already have conda installed, you can try just simply adding Berryconda's default rpi channel and installing Python 3.6:

conda config --add channels rpi
conda install python=3.6
tlhIngan
  • 3,372
  • 5
  • 21
  • 33
Gustavo Bezerra
  • 381
  • 3
  • 4
12

For fast build in Raspberry Pi 3 use the -j4 param in the make command:

make -j4
Peter Hansen
  • 214
  • 1
  • 10
Hector Oliveros
  • 221
  • 2
  • 3
4

I am using a RPi2, and I successfully managed to follow the suggested procedure to install python3.6. But as pointed out by a commenter, I ran into problems with ssl when I tried to install packages with pip.

I learned from another thread on different subject that I need to install ssl before I compile.

sudo apt-get install libssl-dev
wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz
tar xzvf Python-3.6.0.tgz
cd Python-3.6.0/
./configure
make
sudo make install
python3.6 -V
python3.6 -m pip install --upgrade pip
python3.6 -m pip install --user numpy 
sudo apt-get update
sudo apt-get upgrade

sudo apt-get install libatlas-base-dev gfortran

python3.6 -m pip install --user scipy

the installation of scipy with pip takes a very long time (hours) and I am looking for a solution. I'll get back to this. the rest of the installation is now put on hold.

python3.6 -m pip install --user matplotlib

python3.6 -m pip install --user ipython

python3.6 -m pip install --user jupyter

python3.6 -m pip install --user pandas

python3.6 -m pip install --user sympy

python3.6 -m pip install --user nose

The upside of having to compile python3.6 a second time was a much faster compile the second time. On the other hand it takes a long time to install numpy, and that is why i split up the package installation.

vardaasen
  • 39
  • 4
1

You need to install all dependencies. All those warning messages, error messages, and "no" checks need to be addressed.

tlhIngan
  • 3,372
  • 5
  • 21
  • 33
0

To install Python 3.6 on a Raspberry as additional/alternative Python version (without changing the standard Python version) I succeeded with the following commands

sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

cd /usr/bin sudo wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz sudo tar xzf Python-3.6.0.tgz

su root <Enter password for root> cd Python-3.6.0 ./configure make -j4 make altinstall exit

To get the actually installed versions just use the following commands:

enter image description here

See also the this website: https://itler.net/raspberry-pi-python-3-6-x-installation-anleitung/

Michael Hutter
  • 169
  • 2
  • 10