Technolink
Posts: 3
Joined: Fri Jan 04, 2019 3:14 pm

pip3 on model 1b, illegal instruction

Fri Jan 04, 2019 3:26 pm

Hello everyone,

I just fresh installed Stretch lite on my model 1b. After messing around a bit, I noticed pip3 wasn't installed (not sure if that's by default or if I removed it). I'm trying to get pip3 installed, but I'm running into some issues.

When I install via apt-get:

Code: Select all

sudo apt-get install python3-pip -y
And then run, I get this error:

Code: Select all

pip3
Illegal instruction
Apt-Get is fetching version 9.0.1-2+rpt2. I also tried specifing version 9.0.1-2 (not knowing what rpt2 means), but the same problem persists.

I also tried using

Code: Select all

python3 get-pip.py
, but that script also fails with Illegal instruction.

So I'm stuck, this sounds like it has something to do with the 1b using ARMv6. How do I get an ARMv6 compatible version of pip3? Note that python2 and pip have no issues.

Thanks for the help!

mfa298
Posts: 1387
Joined: Tue Apr 22, 2014 11:18 am

Re: pip3 on model 1b, illegal instruction

Fri Jan 04, 2019 4:10 pm

Technolink wrote:
Fri Jan 04, 2019 3:26 pm
I just fresh installed Stretch lite on my model 1b. After messing around a bit, I noticed pip3 wasn't installed (not sure if that's by default or if I removed it). I'm trying to get pip3 installed, but I'm running into some issues.

When I install via apt-get:

Code: Select all

sudo apt-get install python3-pip -y
And then run, I get this error:

Code: Select all

pip3
Illegal instruction
I've seen something similar when a package has included a local copy of openssl built on a newer system (in my case I was trying to build chef which includes all the libraries it uses as part of it's package). In that instance the openssl build system was using what it detected in the system (arm7) rather than what the build environment said to use (arm6).

I realise this isn't much of a solution, but hopefully it might give some clues as to a possible issue.


Technolink wrote:
Fri Jan 04, 2019 3:26 pm
Apt-Get is fetching version 9.0.1-2+rpt2. I also tried specifing version 9.0.1-2 (not knowing what rpt2 means), but the same problem persists.
...
So I'm stuck, this sounds like it has something to do with the 1b using ARMv6. How do I get an ARMv6 compatible version of pip3? Note that python2 and pip have no issues.
my understanding of packaging is that the rpt2 is a tag suggesting something about the build has been altered by the Raspberry Pi Folks (rpt) and it's the 2nd such update (2).

Assuming this is Raspbian rather than some other distribution then the packaged version should be compatible. Maybe something has slipped through by mistake - which would hopefully get spotted and fixed soon.

User avatar
rpdom
Posts: 16972
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: pip3 on model 1b, illegal instruction

Fri Jan 04, 2019 4:27 pm

Odd. I just installed python3-pip 9.0.1-2+rpt2 on a Pi Zero (same CPU as 1B) and had no problems. That Pi wasn't built using the latest stretch image though, it's been running for several months but is kept updated.

Technolink
Posts: 3
Joined: Fri Jan 04, 2019 3:14 pm

Re: pip3 on model 1b, illegal instruction

Fri Jan 04, 2019 7:42 pm

mfa298 wrote:
Fri Jan 04, 2019 4:10 pm
I've seen something similar when a package has included a local copy of openssl built on a newer system (in my case I was trying to build chef which includes all the libraries it uses as part of it's package). In that instance the openssl build system was using what it detected in the system (arm7) rather than what the build environment said to use (arm6).

I realise this isn't much of a solution, but hopefully it might give some clues as to a possible issue.

...

Assuming this is Raspbian rather than some other distribution then the packaged version should be compatible. Maybe something has slipped through by mistake - which would hopefully get spotted and fixed soon.
This is Raspbian Stretch. I did install openssl with certbot, perhaps that contributed to the problem. I'll look into it from that angle, thanks for the hint.

mfa298
Posts: 1387
Joined: Tue Apr 22, 2014 11:18 am

Re: pip3 on model 1b, illegal instruction

Fri Jan 04, 2019 7:57 pm

Technolink wrote:
Fri Jan 04, 2019 7:42 pm
This is Raspbian Stretch. I did install openssl with certbot, perhaps that contributed to the problem. I'll look into it from that angle, thanks for the hint.
From memory

Code: Select all

readelf -A <file>
will tell you what a binary or library is built for among other things. You can also run ldd against a binary or library to see what other libraries are used by it.

Technolink
Posts: 3
Joined: Fri Jan 04, 2019 3:14 pm

Re: pip3 on model 1b, illegal instruction

Fri Jan 04, 2019 8:02 pm

Yep, it was openssl. I was originally using python-certbot-apache, but ended up just using certbot-auto. Running the following commands fixed everything up:

Code: Select all

sudo apt-get remove python3-openssl -y
sudo apt autoremove
sudo apt-get install python3-pip -y
Thanks for the help!

Return to “Troubleshooting”