Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Linux] Illegal instruction error when trying to import psutils #2044

Open
EDIflyer opened this issue Jan 2, 2022 · 7 comments
Open

[Linux] Illegal instruction error when trying to import psutils #2044

EDIflyer opened this issue Jan 2, 2022 · 7 comments

Comments

@EDIflyer
Copy link

EDIflyer commented Jan 2, 2022

Summary

  • OS: Raspberry Pi OS (bullseye) kernel 5.10.63+
  • Architecture: 32-bit ARMv61
  • Psutil version: 5.8.0 working, error with 5.9.0
  • Python version: Python 3.9.2
  • Type: core

Description

Setting up a new bullseye RPi image on a Zero W. Previously had psutil working fine.
Installed via pip3 as usual sudo -H pip3 install --upgrade --force-reinstall --ignore-installed psutil, installation completed OK. However I found my script wouldn't run, crashing out with 'Illegal instruction' (no traceback message, just immediate termination).

I commented out all the imported modules and gradually re-enabled them one by one. As soon as I re-enabled psutil it started crashing again.

I noticed 5.9.0 was a new version and the old version had worked OK on my previous installation so I then downgraded to 5.8.0 via the command sudo pip3 install psutil==5.8.0
This successfully uninstalled 5.9.0 and installed 5.8.0

My python script then started running fine (including the psutil elements)

@EDIflyer EDIflyer added the bug label Jan 2, 2022
@github-actions github-actions bot added the linux label Jan 2, 2022
@urbanze
Copy link

urbanze commented Jan 3, 2022

Same here, v5.9.0 gives "Illegal instruction" immediately after import.

With v5.8.0 work fine.

@Sebwap
Copy link

Sebwap commented Jan 4, 2022

Same here :(

@giampaolo
Copy link
Owner

giampaolo commented Jan 4, 2022

No other message other than that? Ugh! :(
In order to exclude its the wheel package, could you guys try installing psutil from source?

pip install --no-binary :all: psutil

@giampaolo
Copy link
Owner

Also, does it happen on 32 bit only?

@Sebwap
Copy link

Sebwap commented Jan 4, 2022

Note that I have the same problem with Pillow 9.0.0.
An issue is open here: python-pillow/Pillow#5927

@Sebwap
Copy link

Sebwap commented Jan 4, 2022

It works fine with this command: pip install --no-binary :all: psutil


pi@pizerowh:~/displayhatmini $ sudo pip3 install -U --no-binary :all: psutil
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: psutil in /usr/local/lib/python3.9/dist-packages (5.8.0)
Collecting psutil
  Downloading psutil-5.9.0.tar.gz (478 kB)
     |████████████████████████████████| 478 kB 732 kB/s
Skipping wheel build for psutil, due to binaries being disabled for it.
Installing collected packages: psutil
  Attempting uninstall: psutil
    Found existing installation: psutil 5.8.0
    Uninstalling psutil-5.8.0:
      Successfully uninstalled psutil-5.8.0
    Running setup.py install for psutil ... done
Successfully installed psutil-5.9.0
pi@pizerowh:~/displayhatmini $ python3
Python 3.9.2 (default, Mar 12 2021, 04:06:34)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import psutil
>>> exit()
pi@pizerowh:~/displayhatmini $

@opape
Copy link

opape commented Jan 13, 2022

Same here, but with pip3 install --no-binary :all: psutil my Python3 script with import psutil works as expected.

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

No branches or pull requests

5 participants