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

ZMQ with Python 3.7 on Raspberry Pi - Error: ...cython/error.cpython-37m-arm-linux-gnueabihf.so: undefined symbol: zmq_strerror #1323

Closed
HWiese1980 opened this issue Aug 30, 2019 · 13 comments

Comments

@HWiese1980
Copy link

I'm trying to migrate a Python program on a Raspberry Pi from Python 2.7 to Python 3.7. It uses ZMQ for communication with a PC. Now, when running the program in Python 3.7 I'm getting the following error message:

    import zmq
  File "/usr/local/lib/python3.7/site-packages/zmq/__init__.py", line 47, in <module>
    from zmq import backend
  File "/usr/local/lib/python3.7/site-packages/zmq/backend/__init__.py", line 40, in <module>
    reraise(*exc_info)
  File "/usr/local/lib/python3.7/site-packages/zmq/utils/sixcerpt.py", line 34, in reraise
    raise value
  File "/usr/local/lib/python3.7/site-packages/zmq/backend/__init__.py", line 27, in <module>
    _ns = select_backend(first)
  File "/usr/local/lib/python3.7/site-packages/zmq/backend/select.py", line 28, in select_backend
    mod = __import__(name, fromlist=public_api)
  File "/usr/local/lib/python3.7/site-packages/zmq/backend/cython/__init__.py", line 6, in <module>
    from . import (constants, error, message, context,
ImportError: /usr/local/lib/python3.7/site-packages/zmq/backend/cython/error.cpython-37m-arm-linux-gnueabihf.so: undefined symbol: zmq_strerror

Is there a way to fix this issue?

Thank you!

@fiecato
Copy link

fiecato commented Aug 31, 2019

Hello, have you solved this problem? I also encountered this problem.

pi@I3oT-pro:~ $ python3
Python 3.7.3 (default, Jun 13 2019, 13:28:28) 
[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/.local/lib/python3.7/site-packages/zmq/__init__.py", line 47, in <module>
    from zmq import backend
  File "/home/pi/.local/lib/python3.7/site-packages/zmq/backend/__init__.py", line 40, in <module>
    reraise(*exc_info)
  File "/home/pi/.local/lib/python3.7/site-packages/zmq/utils/sixcerpt.py", line 34, in reraise
    raise value
  File "/home/pi/.local/lib/python3.7/site-packages/zmq/backend/__init__.py", line 27, in <module>
    _ns = select_backend(first)
  File "/home/pi/.local/lib/python3.7/site-packages/zmq/backend/select.py", line 28, in select_backend
    mod = __import__(name, fromlist=public_api)
  File "/home/pi/.local/lib/python3.7/site-packages/zmq/backend/cython/__init__.py", line 6, in <module>
    from . import (constants, error, message, context,
ImportError: /home/pi/.local/lib/python3.7/site-packages/zmq/backend/cython/error.cpython-37m-arm-linux-gnueabihf.so: undefined symbol: zmq_strerror

Then I installed it with root.

pi@I3oT-pro:~ $ sudo pip3 install --user pyzmq
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting pyzmq
  Using cached https://www.piwheels.org/simple/pyzmq/pyzmq-18.1.0-cp37-cp37m-linux_armv7l.whl
Installing collected packages: pyzmq
Successfully installed pyzmq-18.1.0
WARNING: You are using pip version 19.1.1, however version 19.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
pi@I3oT-pro:~ $ sudo python3
Python 3.7.3 (default, Jun 13 2019, 13:28:28) 
[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 "/root/.local/lib/python3.7/site-packages/zmq/__init__.py", line 47, in <module>
    from zmq import backend
  File "/root/.local/lib/python3.7/site-packages/zmq/backend/__init__.py", line 40, in <module>
    reraise(*exc_info)
  File "/root/.local/lib/python3.7/site-packages/zmq/utils/sixcerpt.py", line 34, in reraise
    raise value
  File "/root/.local/lib/python3.7/site-packages/zmq/backend/__init__.py", line 27, in <module>
    _ns = select_backend(first)
  File "/root/.local/lib/python3.7/site-packages/zmq/backend/select.py", line 28, in select_backend
    mod = __import__(name, fromlist=public_api)
  File "/root/.local/lib/python3.7/site-packages/zmq/backend/cython/__init__.py", line 6, in <module>
    from . import (constants, error, message, context,
ImportError: /root/.local/lib/python3.7/site-packages/zmq/backend/cython/error.cpython-37m-arm-linux-gnueabihf.so: undefined symbol: zmq_strerror

@HWiese1980
Copy link
Author

Nope, not yet. I guess we need a developer to take a look

@jarednm
Copy link

jarednm commented Oct 3, 2019

Any update on this issue?

@minrk
Copy link
Member

minrk commented Oct 3, 2019

This sounds like it's an issue with the wheels on piwheels.org. I don't maintain those, so I'm not sure what's wrong with them. Try something like:

# install libzmq
apt-get install libzmq5-dev
# build pyzmq
pip install -vv --no-binary pyzmq pyzmq --install-option --zmq=/usr

@GABowers
Copy link

Having the same issue. Tried this--

This sounds like it's an issue with the wheels on piwheels.org. I don't maintain those, so I'm not sure what's wrong with them. Try something like:

# install libzmq
apt-get install libzmq5-dev
# build pyzmq
pip install -vv --no-binary pyzmq pyzmq --install-option --zmq=/usr

--but it still doesn't work. I'm actually having the issue for both 2.7.13 and 3.5.3.

@jarednm
Copy link

jarednm commented Oct 31, 2019

I eventually ditched ubuntu and installed the latest Raspbian. No issues with pyzmq now.

@GABowers
Copy link

GABowers commented Nov 1, 2019

I've also got it working, after running multiple "apt-get update" and "apt-get upgrade cython" cycles.

@henriquearaujo67
Copy link

Good night.
I am just new on python, but I did the following and now it is working correctly:

C:\Users\hbl4731\AppData\Local\Programs\Python\Python37\Scripts>pip uninstall pyzmq
Uninstalling pyzmq-18.1.0:
Would remove:
c:\users\hbl4731\appdata\roaming\python\python37\site-packages\pyzmq-18.1.0.dist-info*
c:\users\hbl4731\appdata\roaming\python\python37\site-packages\zmq*
Would not remove (might be manually added):
c:\users\hbl4731\appdata\roaming\python\python37\site-packages\zmq\backend\cffi_pycache__cffi_ext.c
Proceed (y/n)? y
Successfully uninstalled pyzmq-18.1.0

C:\Users\hbl4731\AppData\Local\Programs\Python\Python37\Scripts>conda
'conda' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\hbl4731\AppData\Local\Programs\Python\Python37\Scripts>pip install --upgrade pyzmq
Collecting pyzmq
Downloading https://files.pythonhosted.org/packages/e8/be/9cbcdf37890942a9f8f09102903dd69d275258752a530b87fe7273fa26ba/pyzmq-18.1.1-cp37-cp37m-win_amd64.whl (1.0MB)
|████████████████████████████████| 1.1MB 1.6MB/s
Installing collected packages: pyzmq
Successfully installed pyzmq-18.1.1

@henriquearaujo67
Copy link

Basically upgraded pyzmq from 18.1.0 to 18.1.1

@lchlch
Copy link

lchlch commented May 6, 2020

Python 2.7.8(centos7 arrch64), Having the same issue. Tried upgraded pyzmq but not worked,any suggestions?

@doubleAbrew
Copy link

Having the issue here too. Running Python 3.7, and pyzmq 19.1. I double checked and tried the pip install --upgrade pyzmq, apt-get update, and the "fix environment" script and no luck either. Reference #471

@wxzzzz
Copy link

wxzzzz commented Oct 18, 2022

help

@minrk
Copy link
Member

minrk commented Feb 27, 2024

pyzmq 26 has a totally ifferent build system, so hopefully this either has been fixed, or will be fixed. Please feel free to reopen if anyone sees issues with pyzmq >=26 (needs --pre for now)

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

No branches or pull requests

9 participants