Issue importing NEURON into Python
Posted: Tue Oct 22, 2013 3:04 pm
Hello, I have for a long time using NEURON on my computer to run various experiments. Some of my experiments have gotten too large / taking too long, so I am attempting to install and run NEURON on a cluster of computers (Linux). I am trying to first install it on a single node of our cluster of computers and am running into some issues importing NEURON into Python.
So, using the download from source instructions, I have successfully ran the following steps (excluding interviews):
The encouraging part is that python is in the directory it is supposed to be and when I run the 'neurondemo' code while in nrn:
the result is :
When I cd back into the directory 'neuron', and I try to run the following program:
The result is:
Obviously, this code works on my normal machine, and so I am just trying isolate the issue I am having between python and NEURON. It seems (after running 'neurondemo') that NEURON was indeed successfully installed on the node, but I don't yet know why the when I call the Python program, it is not finding the neuron module.
The only error type I saw was after running:
when several errors popped up looking like this:
Anything you can see that would help me would be greatly appreciated!!! Thanks!!
So, using the download from source instructions, I have successfully ran the following steps (excluding interviews):
Code: Select all
cd $HOME
mkdir neuron
mv nrn-nn.tar.gz neuron
cd neuron
tar xzf nrn-nn.tar.gz
mv nrn-nn nrn
cd nrn
./configure --prefix=`pwd` --with-nrnpython=/usr/bin/python --without-iv
make
make install
cd src/nrnpython
python setup.py install --prefix=$HOME/local
export PYTHONPATH=$PYTHONPATH:$HOME/local/lib/python/site-packages
Code: Select all
./x86_64/bin/neurondemo
Code: Select all
hendemd@node2:~/neuron/nrn$ ./x86_64/bin/neurondemo
NEURON -- Release 7.3 (849:5be3d097b917) 2013-04-11
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2013
See http://www.neuron.yale.edu/neuron/credits
loading membrane mechanisms from /home/hendemd/neuron/nrn/share/nrn/demo/release/x86_64/.libs/libnrnmech.so
Additional mechanisms from files
cabpump.mod cachan1.mod camchan.mod capump.mod invlfire.mod khhchan.mod mcna.mod nacaex.mod nachan.mod release.mod
oc>
Code: Select all
python test.py
___________
test.py
#
#
#
from neuron import *
Code: Select all
hendemd@node2:~/neuron$ python test.py
Traceback (most recent call last):
File "test.py", line 1, in <module>
from neuron import *
ImportError: No module named neuron
The only error type I saw was after running:
Code: Select all
python setup.py install --prefix=$HOME/local
when several errors popped up looking like this:
Code: Select all
byte-compiling /home/hendemd/local/lib/python2.6/site-packages/neuron/rxd/geometry3d/voxelize.py to voxelize.pyc
SyntaxError: ('invalid syntax', ('/home/hendemd/local/lib/python2.6/site-packages/neuron/rxd/geometry3d/voxelize.py', 106, 70, ' x_objs = {x: [obj for obj in objects if obj.xlo < x < obj.xhi] for x in mesh.xs}\n'))