0

I just installed 2021-05-07-raspios-buster-arm64-lite on my Raspberry Pi 3B+.

uname -a outputs:

Linux raspberrypi 5.10.17-v8+ #1421 SMP PREEMPT Thu May 27 14:01:37 BST 2021 aarch64 GNU/Linux

But after installing Miniconda3 (Miniconda3 Linux-aarch64 64-bit) each call of conda and pip simply outputs Illegal instruction. What could be causing this problem?

5
  • Please edit in the output from file $(which pip).
    – goldilocks
    Jul 19 at 15:43
  • @goldilocks ok, the problem is in conda /home/pi/miniconda3/bin/pip Jul 19 at 16:33
  • Yeah, sorry, I just noticed pip is a python script, so that won't solve the mystery. You could try strace pip ... and see where it fails. You may need to apt install strace.
    – goldilocks
    Jul 19 at 17:52
  • To clarify: the illegal instruction means there's an executable being invoked that is compiled for the wrong ISA (aarch64). file on an executable would reveal what it is compiled for. That pip is in /home/pi implies you've installed stuff that isn't from the buster repo. If that was for the wrong platform, there's your problem.
    – goldilocks
    Jul 19 at 17:57
  • @goldilocks thanks for your help. I've removed conda as a workaround and use pip3 Jul 19 at 18:15
1

Illegal instruction is what you get if you try to execute a binary compiled for, eg., x86(-64), so almost certainly that's what's happened.

Which implies the miniconda installer is to blame. To confirm the premise, you need to find the binaries that pip and conda are trying to execute -- conda may be itself an executable, I'm not familiar with it. You can then examine these with file; here's an example of what I mean using a relatively stock RpiOS 64-bit:

> file (which pip)
/usr/bin/pip: Python script, ASCII text executable

This is how we know pip is actually a python script and not a binary executable file. The first thing in the script is of course #!/usr/bin/python, so:

> file (which python)
/usr/bin/python: symbolic link to python2

> file (which python2)
/usr/bin/python2: symbolic link to python2.7

> file (which python2.7)
/usr/bin/python2.7: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked ...
                                                   ^^^^^^^^^^^

Here I've followed a set of symlinks to the actual binary. Here's the same thing from an x86-64 desktop python3:

> file (which python3.9)
/usr/bin/python3.9: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked ...
                                                   ^^^^^^

Notice the platform architecture is shown: "ARM aarch64" and "x86-64".

If what you get isn't the former, that's what's wrong. Otherwise, try:

> sudo apt install strace
[ ... ]
> strace pip

strace produces copious output detailing the system calls that are being made. Paste the last 25 lines into your question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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