56

I would like to know how to install the latest Anaconda version from Continuum on my Raspberry Pi 3 model B. Any help would be appreciated...

2
  • 1
    As of today - the support is quite bad, you'll get Python 3.4 at most and the available packages are also limited (e.g.: current jupyter requires at least 3.5). While on a PC Anaconda is a good way to get an 'up-to-date' python with rich repositories, it's not so great for RPi. It's easier to update to stretch for Python 3.5 or even buster for 3.7. Nov 15, 2019 at 13:02
  • check berryconda
    – AlvaroP
    May 14, 2020 at 11:21

4 Answers 4

87

Installing Miniconda on Raspberry Pi and adding Python 3.5 / 3.6

Skip the first section if you have already installed Miniconda successfully.

Installation of Miniconda on Raspberry Pi

wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-armv7l.sh
sudo md5sum Miniconda3-latest-Linux-armv7l.sh
sudo /bin/bash Miniconda3-latest-Linux-armv7l.sh

Accept the license agreement with yes

When asked, change the install location: /home/pi/miniconda3

Do you wish the installer to prepend the Miniconda3 install location to PATH in your /root/.bashrc ? yes

Now add the install path to the PATH variable:

sudo nano /home/pi/.bashrc

Go to the end of the file .bashrc and add the following line:

export PATH="/home/pi/miniconda3/bin:$PATH"

Save the file and exit.

To test if the installation was successful, open a new terminal and enter

conda

If you see a list with commands you are ready to go.

But how can you use Python versions greater than 3.4 ?


Adding Python 3.5 / 3.6 to Miniconda on Raspberry Pi

After the installation of Miniconda I could not yet install Python versions higher than Python 3.4, but i needed Python 3.5. Here is the solution which worked for me on my Raspberry Pi 4:

First i added the Berryconda package manager by jjhelmus (kind of an up-to-date version of the armv7l version of Miniconda):

conda config --add channels rpi

Only now I was able to install Python 3.5 or 3.6 without the need for compiling it myself:

conda install python=3.5
conda install python=3.6

Afterwards I was able to create environments with the added Python version, e.g. with Python 3.5:

conda create --name py35 python=3.5

The new environment "py35" can now be activated:

source activate py35

Using Python 3.7 on Raspberry Pi

Currently Jonathan Helmus, who is the developer of berryconda, is working on adding Python 3.7 support, if you want to see if there is an update or if you want to support him, have a look at this pull request. (update 20200623) berryconda is now inactive, This project is no longer active, no recipe will be updated and no packages will be added to the rpi channel. If you need to run Python 3.7 on your Pi right now, you can do so without Miniconda. Check if you are running the latest version of Raspbian OS called Buster. Buster ships with Python 3.7 preinstalled (source), so simply run your program with the following command:

Python3.7 app-that-needs-python37.py

I hope this solution will work for you too!

11
  • 7
    Thank you so much! I've been searching so long for this!
    – Kaito
    Jul 13, 2019 at 9:09
  • 3
    Thank you sir. Really nice explanation Sep 21, 2019 at 17:22
  • 2
    I've been trying to get Python 3.6+ installed for two days now on my ARMv7L machine. I couldn't get Python 3.7 installed, but 3.6 is sufficient. :D Oct 16, 2019 at 20:31
  • 1
    Thank you for putting this together so much <3. This helkped! Feb 13, 2020 at 21:07
  • 1
    Note: berryconda as of early 2020 is no longer active github.com/jjhelmus/berryconda
    – aster94
    Apr 8, 2020 at 18:16
61

On Raspberry Pi 3 Model B - Installation of Miniconda (bundled with Python 3)

Go and get the latest version of miniconda for Raspberry Pi - made for armv7l processor and bundled with Python 3 (eg.: uname -m)

wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-armv7l.sh
md5sum Miniconda3-latest-Linux-armv7l.sh
bash Miniconda3-latest-Linux-armv7l.sh

After installation, source your updated .bashrc file with source ~/.bashrc. Then enter the command python --version, which should give you:

Python 3.4.3 :: Continuum Analytics, Inc.
12
  • 7
    As of the time of posting this comment, Python 3.5 isn't available. How unfortunate! Nov 6, 2016 at 12:59
  • @mahtuag If I get a bit of time I'll check it out
    – Marco
    Nov 7, 2016 at 16:05
  • 3
    For now, I replaced NOOBS (based on Debian 8 Raspbian) with ArchLinux ARM mostly because of the unparalleled high quality of its documentation. This has also given me access to Python 3.5 along with various other up-to-date packages, as ArchLinux is very prompt in upgrading its repositories when the upstream releases newer package versions. I suggest this as a potential stop-gap solution until Miniconda has a little more love for armv7l systems. Nov 10, 2016 at 20:47
  • 2
    Is there any reason why you use sudo? Better practice and more convenient to use not to use sudo to install.
    – user989762
    Feb 7, 2018 at 20:24
  • 1
    Miniconda-latest-Linux-armv7l.sh 19.8M 2015-08-24 ??? 2015 seriously? Can it get any sadder?
    – K J
    May 3, 2019 at 16:30
8

If you're interested in generalizing to different architectures, you could also run the command above and substitute uname -m in with backticks like so:

wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-`uname -m`.sh
8

I was trying to run this on a pi zero. Turns out the pi zero has an armv6l architecture so the above won't work for pi zero or pi one. Alternatively here I learned that miniconda doesn't have a recent version of miniconda. Instead I used the same instructions posted here to install berryconda3

Conda is now working. Hope this helps those of you interested in running conda on the pi zero!

1
  • Yes, you need to always check your machine archtecture. At time of this comment, this page: repo.continuum.io/miniconda contains only miniconda 3.5.5 with Py2. This makes root environment by Py2, but doesn't preclude installing other versions. May 5, 2018 at 21:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.