packages icon indicating copy to clipboard operation
packages copied to clipboard

Problem with package: psutil

Open theyosh opened this issue 4 months ago • 7 comments

Package name

psutil

Package version

higher than 6.0.0.0

PyPI URL

https://pypi.org/project/psutil/

piwheels URL

https://www.piwheels.org/project/psutil/

Python version

  • [x] Python 3.9
  • [ ] Python 3.11

This is for Raspberry Pi users only. If your issue does not relate to usage on Raspberry Pi using the official distro, please don't create an issue here.

yes

The project page includes links to existing issues about the package. Please check this issue doesn't already exist.

yes

Are you the project maintainer?

  • [ ] I am the maintainer

More information

When I install any version higher than 6.0.0 I get a GLIB_C version mismatch. The strange thing is that I did not encountered this earlier. As far I can recall, it had worked? Because the release of version 7.0.0 was more than 6 months ago. And I have tested that version and that worked.

When I look at file size, it is now 268KB. But when I installed it earlier this year, it was 272KB in size. Not sure if this is due to how different software calculate sizes, but I would say, some packages are rebuild-ed recently? Also:

curl -I "https://www.piwheels.org/simple/psutil/psutil-7.0.0-cp36-abi3-linux_armv7l.whl#sha256=15c71f5312cec4d55b23b529579eccbc58e9c36100a906d1de1c66301090f6a9"
HTTP/1.1 200 OK
Date: Sat, 06 Sep 2025 08:16:25 GMT
Server: Apache/2.4.62 (Debian)
Last-Modified: Thu, 04 Sep 2025 12:54:07 GMT
ETag: "42ec0-63df9377a4c4b"
Accept-Ranges: bytes
Content-Length: 274112
Access-Control-Allow-Origin: *

Give a Last-Modified: Thu, 04 Sep 2025 12:54:07 GMT. Not sure if this is due to caching servers.

The error when importing the psutil package:

  File "/home/pi/TerrariumPI/venv/lib/python3.9/site-packages/psutil/__init__.py", line 95, in <module>
    from . import _pslinux as _psplatform
  File "/home/pi/TerrariumPI/venv/lib/python3.9/site-packages/psutil/_pslinux.py", line 26, in <module>
    from . import _psutil_linux as cext
ImportError: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.34' not found (required by /home/pi/TerrariumPI/venv/lib/python3.9/site-packages/psutil/_psutil_linux.abi3.so)

This happening on Raspberry PI with Bullseye OS and Python 3.9 in a virtual environment. All packages up to date. The max version of GLIB_C is: 2.30 in file /lib/arm-linux-gnueabihf/libc.so.6.

strings /lib/arm-linux-gnueabihf/libc.so.6 | grep -i glibc_:

GLIBC_2.4
GLIBC_2.5
GLIBC_2.6
GLIBC_2.7
GLIBC_2.8
GLIBC_2.9
GLIBC_2.10
GLIBC_2.11
GLIBC_2.12
GLIBC_2.13
GLIBC_2.14
GLIBC_2.15
GLIBC_2.16
GLIBC_2.17
GLIBC_2.18
GLIBC_2.22
GLIBC_2.23
GLIBC_2.24
GLIBC_2.25
GLIBC_2.26
GLIBC_2.27
GLIBC_2.28
GLIBC_2.29
GLIBC_2.30
GLIBC_PRIVATE

What did I do wrong? Or how can I fix this?

theyosh avatar Sep 06 '25 08:09 theyosh

After some more searching it does look like the files are rebuild-ed. Because I looked at a backup from a month old, and there the files are smaller in size.

-rwxr-xr-x 8 pi pi 92320 aug  5 21:44 _psutil_linux.abi3.so
-rwxr-xr-x 8 pi pi 51280 aug  5 21:44 _psutil_posix.abi3.so

where the latest installed is:

-rwxr-xr-x   1 pi pi 138484 Sep  6 09:47 _psutil_linux.abi3.so
-rwxr-xr-x   1 pi pi 104552 Sep  6 09:47 _psutil_posix.abi3.so

And there it is clear that the *.so files are different in size.

So it looks like the build system is using a to high LIBC version?

theyosh avatar Sep 06 '25 08:09 theyosh

Can confirm, seeing the same. Last good version is apparently 6.0.0, anything later is broken on bullseye:

  • piwheels 5.9.8: ✅
  • piwheels 6.0.0: ✅
  • piwheels 6.1.0: ❌
  • piwheels 6.1.1: ❌
  • piwheels 7.0.0: ❌

Local build from the sdist on PyPI however works:

  • pypi sdist 6.1.1: ✅

piwheels' 6.1.1 was definitely still good on June 10th when I did the last update test for OctoPrint 1.11.2, now during the update tests for 1.11.3 I noticed this issue.

foosel avatar Sep 08 '25 14:09 foosel

Give a Last-Modified: Thu, 04 Sep 2025 12:54:07 GMT. Not sure if this is due to caching servers.

FWIW, the build log of the current psutil 6.1.1 wheel on piwheels also states Sep 04:

2025-09-04T11:54:47,591 Created temporary directory: /tmp/pip-build-tracker-fe20zsvu
2025-09-04T11:54:47,592 Initialized build tracking at /tmp/pip-build-tracker-fe20zsvu
[...]
2025-09-04T11:55:04,214 Successfully built psutil

foosel avatar Sep 08 '25 14:09 foosel

For some reason this must have been rebuilt recently. Unfortunately we never resolved the ABI ordering bug which puts cp39 after cp311, so it got built on Bookworm first. I've skipped the recent versions for now. When I get chance I'll rebuild them on cp39 and import them.

bennuttall avatar Sep 08 '25 16:09 bennuttall

Apparently version 7.1.0 got released and built on piwheels yesterday and that's showing the same problem under bullseye, which means the canary build triggered tonight:

#13 144.7 Collecting psutil<8,>=7
#13 145.4   Downloading https://piwheels.org/simple/psutil/psutil-7.1.0-cp36-abi3-linux_armv7l.whl (281 kB)
2025-09-19 01:44:06,918 - octoprint.startup - CRITICAL - There was a fatal error initializing OctoPrint:
Traceback (most recent call last):
  File "/octoprint/venv/lib/python3.9/site-packages/octoprint/__init__.py", line 185, in init_platform
    environment_detector = init_environment_detector(plugin_manager)
  File "/octoprint/venv/lib/python3.9/site-packages/octoprint/__init__.py", line 989, in init_environment_detector
    from octoprint.environment import EnvironmentDetector
  File "/octoprint/venv/lib/python3.9/site-packages/octoprint/environment.py", line 11, in <module>
    import psutil
  File "/octoprint/venv/lib/python3.9/site-packages/psutil/__init__.py", line 93, in <module>
    from . import _pslinux as _psplatform
  File "/octoprint/venv/lib/python3.9/site-packages/psutil/_pslinux.py", line 26, in <module>
    from . import _psutil_linux as cext
ImportError: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.34' not found (required by /octoprint/venv/lib/python3.9/site-packages/psutil/_psutil_linux.abi3.so)

Maybe psutil should be blocked for now under bullseye until the ABI ordering bug is solved?

foosel avatar Sep 19 '25 07:09 foosel

Done, should be gone soon and it's been skipped.

bennuttall avatar Sep 19 '25 09:09 bennuttall

Can confirm, canary build is green again!

foosel avatar Sep 19 '25 10:09 foosel