ZeroCM / zcm

Zero Communications and Marshalling
http://zerocm.github.io/zcm/
GNU Lesser General Public License v2.1
233 stars 67 forks source link

Error when ZCM runs under Python3 #397

Closed cwjwudi closed 2 years ago

cwjwudi commented 2 years ago

I have followed the tutorial to compile and install normally, and the program runs normally in C++. But there is a problem running under Python.

When I try to run the

from zerocm import ZCM

There is an error

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: dynamic module does not define module export function (PyInit_zerocm)

I have follow the tutorial, add

export LD_LIBRARY_PATH=/usr/lib:/usr/local/lib

to the ~/.bashrc.

And, copy the ../zcm/build/zcm/python/zerocm.cpython-38-x86_64-linux-gnu.so to the /usr/local/lib/python3.8/dist-packages.

Python seems to find the zcm library and document libzcm.so, but something is missing. I am using python version 3.8 that comes with ubuntu 20.04.

Hope to get your help.

jbendes commented 2 years ago

Did you read the examples section here: https://zcm-project.org/docs/building.html? If you source the env file you shouldn't have a problem. I would recommend going through the entire building page