mattjj / pyhsmm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No module named hsmm_messages_interface

hedgy123 opened this issue · comments

Hi,

I am trying to reproduce the example in your readme file on my Mac Yosemite. I used the travis file to set up the environment (using g++-5 and gcc-5). I get lots of linker warnings like this one while building the package (w/python setup.py build_ext --inplace):

ld: warning: could not create compact unwind for __ZL87__pyx_fuse_0__pyx_pw_6pyhsmm_9internals_23hsmm_messages_interface_13sample_forwards_logP7_objectS0_S0_: stack subq instruction is too different from dwarf stack size

for both hmm_messages_interface and hsmm_messages_interface. When I ran the tests (nosetests tests -A 'not slow') I get:

ImportError: No module named 'hmm_messages_interface'

And when I attempted to run the readme example, I got a similar error ( triggered by posteriormodel.resample_model()):

/Users/<USER>/anaconda/lib/python3.5/site-packages/pyhsmm-0.1.6-py3.5-macosx-10.5-    x86_64.egg/pyhsmm/internals/hsmm_states.py in messages_backwards(self)
    501         # NOTE: np.maximum calls are because the C++ code doesn't do
    502         # np.logaddexp(-inf,-inf) = -inf, it likes nans instead
--> 503         from hsmm_messages_interface import messages_backwards_log
    504         betal, betastarl = messages_backwards_log(
    505                 np.maximum(self.trans_matrix,1e-50),self.aBl,np.maximum(self.aDl,-1000000),

   ImportError: No module named 'hsmm_messages_interface'

Could you guys please help? Could the linker warnings have had something to do with this?

Thank you very much!

Those two modules, hmm_messages_interface and hsmm_messages_interface, are .so files generated from the build process. So it's likely that the build is failing, or the build is working but it's not happening in the right place.

From the error message, it looks like the pyhsmm getting imported is actually in your site-packages directory. If you ran the python setup.py build_ext --inplace, it could be that the build succeeded in your local directory, but since the import is resolving to the site-packages version it can't see the generated modules.

Can you make sure you're importing the version where you built the extension modules? You could set your PYTHONPATH environment variable, or try running pip install -e . to link the git repository version into site-packages.

Everything worked, thanks so much!