I installed Neuron release 7.4 (1370:16a7055d4a86) on my account in a cluster under Red Hat Enterprise Linux Server release 7.3. I followed carefully the steps suggested in https://www.neuron.yale.edu/neuron/down ... pile_linux to get Python+Neuron, i.e., I used the --with-nrnpython option for ./configure. The cluster has Python 2.7.10.
"nrniv -python" worked as expected, and no error doing "from neuron import h".
Next, to be able to import Neuron into Python, I did:
Code: Select all
python setup.py install --prefix=$HOME/local
Code: Select all
export PYTHONPATH=$PYTHONPATH:$HOME/local/lib64/python/site-packages
Again, everything seemed fine:
Code: Select all
python
Python 2.7.10 (default, Nov 10 2015, 18:09:20)
[GCC Intel(R) C++ gcc 4.8 mode] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from neuron import h
Warning: no DISPLAY environment variable.
--No graphics will be displayed.
NEURON -- Release 7.4 (1370:16a7055d4a86) 2015-11-09
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2015
See http://www.neuron.yale.edu/neuron/credits
Code: Select all
module load python/2.7.10
However, I get the following error when trying to use the Vector.as_numpy() function, which my code -that works fine on two other different machines- heavily relies on:
Code: Select all
>>> import numpy as np
>>> from neuron import h
Warning: no DISPLAY environment variable.
--No graphics will be displayed.
NEURON -- Release 7.4 (1370:16a7055d4a86) 2015-11-09
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2015
See http://www.neuron.yale.edu/neuron/credits
>>> v = h.Vector(5).indgen()
>>> v.as_numpy()
NEURON: Vector.as_numpy() error
near line 0
objref hoc_obj_[2]
^
Vector[0].as_numpy()
oc_restore_code tobj_count=1 should be 0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: hoc error
>>>
Looking in the Forum, I thought this may have to do: viewtopic.php?f=2&t=2434 because I realized that I could not import numpy from Neuron (i.e., nrniv -python). So I reinstalled everything using the ./configure options indicated there and I guessed my correct Python paths using "module show python/2.7.10". I was able now to import numpy in "nrniv -python". However, the error with Vector.as_numpy() persisted.
Someone appeared to have a similar problem (viewtopic.php?f=5&t=3548), but I'm hesitant to install an alpha version since the combination Python 2.7 + Neuron 7.4 works perfectly fine in two other machines (both Ubuntu though).
Any ideas on what the problem might be?
Thanks a lot!