mattjj / pyhsmm

MIT License
547 stars 173 forks source link

No module named pyhsmm after following Readme instructions on Home page #14

Closed nipunbatra closed 11 years ago

nipunbatra commented 11 years ago

Hi, I cloned the repo as told on the Readme. Tried running examples from the example directory, but it would say that no module named pyhsmm. Does something else have to be run to get it into site packages etc.?

mattjj commented 11 years ago

It needs to go somewhere in your Python path. Here are three options:

  1. Copy or link pyhsmm to site-packages, e.g. ln -s /path/to/pyhsmm /path/to/site-packages/pyhsmm
  2. Run the Python interpreter inside the directory where you cloned pyhsmm (i.e. the parent directory to pyhsmm), e.g. cd /parent/directory; python pyhsmm/examples/hsmm.py
  3. Add pyhsmm to your PYTHONPATH environment variable, e.g. in Bash or zsh export PYTHONPATH=$PYTHONPATH:/path/to/pyhsmm/

I think perhaps you ran code directly inside the examples directory without having pyhsmm on your Python path. From there, you could do option 2 via cd ../..; python pyhsmm/examples/hsmm.py.

nipunbatra commented 11 years ago

Sure. Was just wondering if you had created a setup.py. Never the less, linking works. Maybe, this can be added to the Readme?

And ofcourse one could do a sys.path.append within the main code too.

mattjj commented 11 years ago

Both are great ideas! I'll add something to the README now and put together a setup.py sometime in the future.