Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Anaconda on Raspberry Pi 4 with Ubuntu 20.04

I am having issues installing Anaconda on my Raspberry Pi.

When I attempt to install Anaconda I get this message:

Anaconda3-20.02-Linux-x86_64.sh: line 404:/home/ubuntu/anaconda3/conda.exe: cannot execute binary file: Exec format error

When I try installing installing mini conda i get this:

ERROR: cannot execute native linux-armv7l binary, output from 'unman -a' is: Linux user 5.4.0-1008-raspi #8-Ubuntu SMP Wed Apr 8 11:13:06 UTC 2020 aarch64 aarch64 aaarch64 GNU/Linux

like image 257
Matt Avatar asked Apr 29 '20 17:04

Matt


People also ask

Is Anaconda compatible with Ubuntu?

Type yes so that you can initialize Anaconda3. You'll receive some output that states changes made in various directories. One of the lines you receive will thank you for installing Anaconda. You can now activate the installation by sourcing the ~/.

Can I install Anaconda on Raspberry Pi?

Yes and no. You can download the proper files from Continuum (they make Anaconda/Miniconda), but you need to make certain the distribution your download matches your CPU architecture. In the case of the Raspberry Pi 3B+, this is an ARM chip (which isn't the same type of chip found in a regular desktop PC).


3 Answers

Looks like you're trying to install the 64-bit version but the Raspberry Pi 4 runs on 32-bit. Use the 32-bit versions and you should be okay!

I've recently installed miniconda on my Raspberry Pi 4. I did it using the following commands:

# Update linux
sudo yum update -y

# Install python3
sudo yum install -y python3

# Download miniconda installation (32-bit version)
curl "https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-armv7l.sh" -o "Miniconda.sh"

# Run miniconda installation
bash ./Miniconda.sh

Once you've done this, I would also recommend doing the following after restarting your terminal:

# Add Raspberry Pi channel for conda installations
conda config --add channels rpi

# Update conda
conda update conda

# Install Spyder IDE
sudo apt-get install spyder3

like image 61
Blithering Avatar answered Oct 19 '22 08:10

Blithering


The problem is it looks like you're using the wrong shell script to install:

Anaconda3-20.02-Linux-x86_64.sh

The Raspberry PI 4 has ARM architecture and is capable of running ARM-64 instructions if you have the 64-bit version of Ubuntu installed. You can check with uname -a and if you see aarch64 you can run the 64-bit instruction set.

It looks like your distribution is for 32-bit ARM, due to the armv7l output from uname so you would want to look for packages with the armv7l suffix.

There is not very good ARM support right now with a lot of software but hopefully that will change now that Apple is moving to ARM-64.

If Anaconda offers a shell script it should look like this:

For 32-bit ARM:

  • Anaconda3-20.02-Linux-armv7l.sh
  • Anaconda3-20.02-Linux-aarch32.sh

For 64-bit ARM:

  • Anaconda3-20.02-Linux-arm64.sh
  • Anaconda3-20.02-Linux-aarch64.sh
like image 33
Alex W Avatar answered Oct 19 '22 09:10

Alex W


Conda does not currently provide any aarch64 prebuilt binaries.

You can instead use conda-forge: https://github.com/conda-forge/miniforge/#download

like image 3
garlix Avatar answered Oct 19 '22 09:10

garlix