Skip to content

Instantly share code, notes, and snippets.

@irdanish11
Last active October 8, 2024 00:19
Show Gist options
  • 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
@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