Skip to content

Instantly share code, notes, and snippets.

@irdanish11
Last active April 18, 2024 16:02
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save irdanish11/263ffffacbbee2a4dd8f2949fb9e2b1b to your computer and use it in GitHub Desktop.
Save irdanish11/263ffffacbbee2a4dd8f2949fb9e2b1b to your computer and use it in GitHub Desktop.
Installing miniconda on raspberry pi4-b

refer to: https://stackoverflow.com/questions/39371772/how-to-install-anaconda-on-raspberry-pi-3-model-b

{USER}: pi

Install Miniconda 3:

wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-armv7l.sh
sudo md5sum Miniconda3-latest-Linux-armv7l.sh # (optional) check md5
sudo /bin/bash Miniconda3-latest-Linux-armv7l.sh 
# -> change default directory to 
/home/pi/miniconda3
#open the bashrc
sudo nano /home/pi/.bashrc 
# -> add this line: 
export PATH="/home/pi/miniconda3/bin:$PATH"

Test:

conda
python --version

If Conda update miss permission of the directory:

sudo chown -R pi miniconda3

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
@virencarriethakur
Copy link

Unable to install on raspberry pi bulleseye 64 bit version. i
...
....
nstalling: zlib-1.2.8-0 ...
installing: conda-3.16.0-py34_0 ...
installing: pycrypto-2.6.1-py34_0 ...
Miniconda3-latest-Linux-armv7l.sh: line 266: /root/miniconda3/pkgs/python-3.4.3-1/bin/python: No such file or directory
ERROR:
cannot execute native linux-armv7l binary, output from 'uname -a' is:
Linux raspberrypi 5.10.92-v8+ #1514 SMP PREEMPT Mon Jan 17 17:39:38 GMT 2022 aarch64 GNU/Linux
pi@raspberrypi:~ $

@virencarriethakur
Copy link

ERROR:
cannot execute native linux-armv7l binary, output from 'uname -a' is:
Linux raspberrypi 5.10.92-v8+ #1514 SMP PREEMPT Mon Jan 17 17:39:38 GMT 2022 aarch64 GNU/Linux
pi@raspberrypi:~ $
on rapberrypi 4 b, bulleseye 64 bit , aarch64 version.

@irdanish11
Copy link
Author

@virencarriethakur Miniconda 3 package is pretty much outdated for ARM. So sorry for that issue.

@PWFYeung
Copy link

PWFYeung commented Jun 3, 2022

Not sure if related, but I could not install miniconda on my raspberry pi 4 at all. It keeps returning the error "illegal operation". Then I found this discussion online: Miniconda on raspberry pi that suggested using miniforge instead. I tried it and it worked. Not sure if this is helpful.

@irdanish11
Copy link
Author

Thanks, @PWFYeung we'll have a look

@pwobus
Copy link

pwobus commented May 30, 2023

mean while almost a year later (may 2023) and its still borked.

@DanBachmann
Copy link

I've had good results with the following:

installing Miniconda:

  1. use the Raspberry Pi OS 64 bit version
  2. install Miniconda following these instructions (Miniforge): https://forums.raspberrypi.com/viewtopic.php?t=316338
  3. close the terminal and open a new terminal. You should see (base) in the command prompt.
  4. This will default to Python 3.1. To use a different version of Python, you can specify the version. For example to create your_environment to use Python 3.8: conda create -n your_environment python=3.8

Hope that helps someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment