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

GLIBC_2.28 not found when using Python after "pip install zmq" on Raspberry Pi 3b #1678

Closed
dangu opened this issue Mar 25, 2022 · 3 comments
Closed
Labels

Comments

@dangu
Copy link

dangu commented Mar 25, 2022

Issue description

Error when trying to use the python version of zmq on a Raspberry Pi with Raspbian OS.
The error is "version `GLIBC_2.28' not found"

Environment

Minimal test code / Steps to reproduce the issue

  1. mkdir zmq_test && cd zmq_test
  2. pip install zmq
  3. python
  4. Inside the python interpreter:
  5. import zmq

What's the actual result? (include assertion message & call stack if applicable)

pi@raspberrypi:~/zmq_test $ python
Python 3.9.10 (main, Jan 26 2022, 13:24:57) 
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import zmq
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'zmq'
>>> 
pi@raspberrypi:~/zmq_test $ pip install zmq
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting zmq
  Downloading https://www.piwheels.org/simple/zmq/zmq-0.0.0-py3-none-any.whl (2.0 kB)
Collecting pyzmq
  Downloading https://www.piwheels.org/simple/pyzmq/pyzmq-22.3.0-cp39-cp39-linux_armv7l.whl (6.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.8/6.8 MB 3.4 MB/s eta 0:00:00
Installing collected packages: pyzmq, zmq
Successfully installed pyzmq-22.3.0 zmq-0.0.0
pi@raspberrypi:~/zmq_test $ python
Python 3.9.10 (main, Jan 26 2022, 13:24:57) 
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import zmq
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/.pyenv/versions/3.9.10/lib/python3.9/site-packages/zmq/__init__.py", line 61, in <module>
    _load_libzmq()
  File "/home/pi/.pyenv/versions/3.9.10/lib/python3.9/site-packages/zmq/__init__.py", line 36, in _load_libzmq
    from . import libzmq
ImportError: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.28' not found (required by /home/pi/.pyenv/versions/3.9.10/lib/python3.9/site-packages/zmq/libzmq.cpython-39-arm-linux-gnueabihf.so)
>>> 

What's the expected result?

The "import zmq" statement should succeed without errors

@dangu
Copy link
Author

dangu commented Mar 25, 2022

Progress: Following the instructions in "Building and installation" here:https://github.com/zeromq/pyzmq
Executing the following commands:

  1. pip uninstall pyzmq

    [...] Successfully uninstalled pyzmq-22.3.0
    
  2. sudo apt-get install libzmq3-dev

    (some successful apt-get messages)
    
  3. pip install --no-binary=:all: pyzmq

    Successfully installed pyzmq-22.3.0
    
  4. python

    Python 3.7.12 (default, Jan 26 2022, 13:39:12) 
    

(Oops, apparently I was using 3.7.12 here, 3.9.10 above...)

  1. import zmq

    >>> 
    

Wow! Works!

  1. pip list

    Package    Version
    ---------- -------
    pip        22.0.4
    pyzmq      22.3.0
    setuptools 47.1.0
    

Conclusion: Installing with "pip install --no-binary" works, after installing libzmq3-dev. Note that my goal is using pipenv though. I need to check how to use --no-binary with pipenv.

@bluca bluca transferred this issue from zeromq/libzmq Mar 25, 2022
@dangu
Copy link
Author

dangu commented Mar 25, 2022

Next test: Using python 3.9.10

The above steps seem to work with 3.9.10. Now trying to do the same but without installing libzmq3-dev.

  1. pyenv local 3.9.10

    (Python switched to 3.9.10)
    
  2. sudo apt remove libzmq3-dev

    (success)
    
  3. pip install --no-binary pyzmq pyzmq

    (takes a loooooong time. Feels like longer than when libzmq3-dev was installed)

  4. python

    Python 3.9.10 (main, Jan 26 2022, 13:24:57) 
    
  5. import zmq

    >>>
    

Yay!

Conclusion: Installing with "pip install --no-binary" works with python 3.9.10 too, even without libzmq3-dev. Takes a loooong time to compile though.

@minrk minrk added the question label Mar 28, 2022
@minrk
Copy link
Member

minrk commented Mar 28, 2022

I think this is a question for the piwheels service, since those are unofficial wheels. The error means that the wheel was built targeting a newer glibc than you have. You can ask there about what the right course of action is. Judging from this PR, I suspect they only build wheels targeting the system Python version for each supported Debian version, so you have a Python 3.9 wheel which targets Bullseye (Debian 11), but you are trying to run it on a too-old Debian 9.

FWIW, pyzmq's official wheels now include aarch64 (not armv7l), so if you can run aarch64 you might be able to use the default wheels, which have correct manylinux tags to only install wheels if the host has supported glibc version.

@minrk minrk closed this as completed Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants