Question

Today I got PyNest working, after I followed the instructions about installation etc. from their official site. My problem is that I have to run the following command before I can successfully import nest, otherwise I get an "ImportError: No module named nest" :

export PYTHONPATH=/opt/nest/lib/python2.7/site-packages:$PYTHONPATH

I found about this command on the official link I gave you above, but I don't understand why this happens. What I can guess is that, this command "shows" where my nest/python files are, but how can I make this command permanent, so I won't have to run in before every trial?

EDIT1: I tried @SumitGupta 's answer and I can now import it when I run python from a terminal, but I get the same error when I try to import nest from Geany or iPython.

(i use Ubuntu 12.04 through VMware virtualization from win8.1 if it matters)

Was it helpful?

Solution 2

Ok the trick was to install nest in a directory like: '/home/username/opt/nest' cause otherwise nest won't find python by itself. For example this didn't work: '/~/opt/nest' Also, be sure to install all the required libraries before the installation (libgsl,libncurse etc.). If you do these two things, you will probably never meet any of my problems.

  • For Geany I could not find a way to change PYTHONPATH but for Spyder, there is an option in 'Tools' that's pretty easy to use (you just find your pythonpath directory manually)
  • For iPython, I followed these instructions and entered my path instead of '~/code/eol_hsrl_python' and '~/hsrl_config'

OTHER TIPS

try adding it in .profile or .bashrc or .bashrc_profile whatever exists depending upon which is called finally , in Ubuntu i guess its .bashrc . These files will be unde user's home

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top