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

WANT_STATSD make all build succeeds, but import doesn't work in python3 #187

Closed
sith0008 opened this issue Jun 25, 2020 · 5 comments
Closed

Comments

@sith0008
Copy link

sith0008 commented Jun 25, 2020

Hi, I managed to build Bjoern using make all (but python setup.py doesn't work as per #185 ) and I had to manually copy the bjoern.py and _bjoern.so files to the python lib directory. Is that supposed to be the case? because when I checked my environment variables, the paths to the files are not added to the PATH

Also, I could start a python2 shell and import bjoern but when I tried using python3, the import fails because of this error:

ImportError: dynamic module does not define module export function (PyInit__bjoern)

Does make all only work for python2?

[Context: I'm building it in docker, using the python:3.7-slim image which is based on Debian]

@jonashaag
Copy link
Owner

Can you please show the exact commands you are using

@jonashaag
Copy link
Owner

jonashaag commented Jun 25, 2020

Also try using make PYTHON=python2 for building for the non-system-default Python version

@sith0008
Copy link
Author

sith0008 commented Jun 25, 2020

Thanks for your reply! I tried make all PYTHON=python3 and I managed to import bjoern from a python3 shell! But the same issue of having to copy the files manually to /usr/local/lib/python3 remains. For the steps to reproduce, after cloning the bjoern repository and the http-parser and statsd-c-client repository, i ran WANT_STATSD=yes WANT_STATSD_TAGS=yes PYTHON=python3 make all

@jonashaag
Copy link
Owner

I don't understand what you mean by manually copying. Obviously you have to put the files at some place where the Python interpreter can find them, and if you're not starting the interpreter from the bjoern folder it means they have to be somewhere else in PYTHONPATH.

@sith0008
Copy link
Author

alright, got it thank you!

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

2 participants