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

compiled libqi-python for python 3.4 can't import it #2

Closed
NoiZeR355 opened this issue Apr 28, 2016 · 13 comments
Closed

compiled libqi-python for python 3.4 can't import it #2

NoiZeR355 opened this issue Apr 28, 2016 · 13 comments

Comments

@NoiZeR355
Copy link

Hi,

I compiled libqi-python for python 3.4 but when I'm trying to import it I got the following error.

File "/lib/python3.4/site-packages/qi/init.py", line 85, in
from _qi import Application as _Application
ImportError: dynamic module does not define init function (PyInit__qi)

Does someone have a clue how I can fix that?

@robertanto
Copy link

robertanto commented Jan 3, 2021

It seems from StackOverflow1 & StackOverflow2 that the problem is in the way we compiled the libboost-python library.

In my case, the import does not work even with python 2.7.

@nyibbang
Copy link
Member

nyibbang commented Jan 4, 2021

libqi-python is currently being ported to Python 3, but note that only Python 3.5+ will be supported.
The team/platform/dev branch contains the modifications related to Python 3.

@robertanto
Copy link

robertanto commented Jan 4, 2021

Thank you @nyibbang for your help!

In my case, I have compiled on the Jetson TX2 Platform (arm).
As suggested in #9 I compiled the release 2.5 on Ubuntu 16.04 (container) using Boost 1.64.0 .
I compiled libboost_python.so.1.64.0 using python2.7.

Is there a way to overcome this problem?

File  "/usr/lib/python2.7/dist-packages/qi/__init__.py", line 88, in 
from _qi import Application as _Application
ImportError: dynamic module does not define init function (init_qi)```

@nyibbang
Copy link
Member

nyibbang commented Jan 4, 2021

Which branch did you use to build libqi-python ?
Do you have a _qi.so library in your build directory ?

@robertanto
Copy link

I built the branch "release-2.5" and applied these patches.

Yes, I have the _qi.so file.

@nyibbang
Copy link
Member

nyibbang commented Jan 5, 2021

If you run readelf -d _qi.so | grep init readelf -s _qi.so | grep init, do you see the init_qi symbol ?

@robertanto
Copy link

No.

@nyibbang
Copy link
Member

nyibbang commented Jan 5, 2021

Sorry, I meant readelf -s _qi.so | grep init

@robertanto
Copy link

robertanto commented Jan 5, 2021

yes, I see it!

@nyibbang
Copy link
Member

nyibbang commented Jan 5, 2021

Check that the symbol is exposed correctly (in the readelf output, the content of the 6th column should be DEFAULT).
Then try setting the PYTHONPATH environment variable to the path containing the _qi.so library when running your python interpreter.

Also it seems you installed the qi python module using pip (from the path /usr/lib/python2.7/dist-packages/qi), which should come with its owns _qi.so library. But from what I understand you also compiled it from the sources ? also at the beginning, this was about Python 3.4, but there it seems you're using Python 2.7. I'm a bit confused.

@robertanto
Copy link

I am sorry for that.

I am not the author of the issue. I have the same problem but with Python2.7.
I have compiled the library on the Jetson TX2 Platform (arm) because I can't install it from pypi.
To do that, I created a Docker container with Ubuntu 16.04 and Boost 1.64.0.

I confirm that the content of the 6th column is DEFAULT!

@robertanto
Copy link

Then try setting the PYTHONPATH environment variable to the path containing the _qi.so library when running your python interpreter.

Same output.

@nyibbang
Copy link
Member

nyibbang commented Jan 5, 2021

Okay I understand a bit better now, although I doubt the two issues are related. I'm going to close this issue and we can discuss your issue on #9

@nyibbang nyibbang closed this as completed Jan 5, 2021
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

3 participants