psutil icon indicating copy to clipboard operation
psutil copied to clipboard

[Linux] Illegal instruction error when trying to import psutils

Open EDIflyer opened this issue 3 years ago • 7 comments

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 avatar Jan 02 '22 18:01 EDIflyer

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

With v5.8.0 work fine.

urbanze avatar Jan 03 '22 19:01 urbanze

Same here :(

Sebwap avatar Jan 04 '22 21:01 Sebwap

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 avatar Jan 04 '22 21:01 giampaolo

Also, does it happen on 32 bit only?

giampaolo avatar Jan 04 '22 21:01 giampaolo

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

Sebwap avatar Jan 04 '22 21:01 Sebwap

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 $

Sebwap avatar Jan 04 '22 21:01 Sebwap

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

opape avatar Jan 13 '22 11:01 opape