import nest
gives the 'no module named nest' error when it is in the $PATH
, which means that there is a /opt/nest/lib/python2.7/site-packages:
in my system $PATH
. At this location there is a directory named nest
and the structure inside the nest
directory is looks like:
, where there is an __init__.py
obviously. So why can't python find nest
?
more information:
I am sure that I installed nest with python2.7, and run it with the same python2.7.
According to the docs, there are several ways to install python packages:
distutils
- runningpython setup.py install
installs the package tosite-packages
of your current distribution;--user
tosetup.py install
installs module to~/.local/lib/python2.7/site-packages
on Unix, and this directory in under normal conditions always included insys.path
;--home=$HOME
tosetup.py install
installs module under$HOME
directory. This directory should be included tosys.path
explicitly;you can do either
in the beginning of your script; or your can add
in the end of your
~/.bash_profile
file.UPDATE:
Just tried to install
nest
and found that it comes in two flavours - 32bit (under/opt/nest/lib
) and 64bit (under/opt/nest/lib64
). You might have tried to use 32-bit python package with 64-bit python distribution. Try to change the string in./zshrc
toPYTHONPATH=/opt/nest/lib64/python2.7/site-packages
and see if it works. It works for me at least.