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

ImportError: dynamic module does not define init function #26

Open
mtrth opened this issue Aug 18, 2015 · 4 comments
Open

ImportError: dynamic module does not define init function #26

mtrth opened this issue Aug 18, 2015 · 4 comments

Comments

@mtrth
Copy link

mtrth commented Aug 18, 2015

I followed the instructions in the readme and compiled with -DUSE_PYTHON=2 , when I do bash eval_all.sh I get error:

Traceback (most recent call last):
File "train_lpo.py", line 31, in
from lpo import *
File "/home/revathy/lpo-release/src/lpo.py", line 45, in
from python.lpo import *
ImportError: dynamic module does not define init function (PyInit_lpo)

hope you could help me. Thanks.

@philkr
Copy link
Owner

philkr commented Sep 5, 2015

Is the lpo module built? Is there an lpo.so? Are you building lpo with the same version of python as you're calling it?

@mtrth
Copy link
Author

mtrth commented Sep 10, 2015

ya I did
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DDATA_DIR=/path/to/datasets -DUSE_PYTHON=ON
make -j9

also I have lpo.so in build/lib/python.

$ python version
Python 2.7.10 :: Anaconda 2.3.0 (64-bit)

@philkr
Copy link
Owner

philkr commented Sep 10, 2015

I have only gotten this error, when I build lpo with boost-python3 and run it with python2 or vice versa.

@liao1995
Copy link

i have gotten this error too, if you build lpo with python2, you need modify python3 to python2 in file eval_all.sh:
P=${PYTHON:=python2}

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