lpo icon indicating copy to clipboard operation
lpo copied to clipboard

ImportError: dynamic module does not define init function

Open mtrth opened this issue 10 years ago • 4 comments

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.

mtrth avatar Aug 18 '15 21:08 mtrth

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?

philkr avatar Sep 05 '15 12:09 philkr

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)

mtrth avatar Sep 10 '15 00:09 mtrth

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

philkr avatar Sep 10 '15 00:09 philkr

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}

liao1995 avatar Sep 26 '16 03:09 liao1995