ModelView and ModuleNotFoundError: No module named 'numpy'
Posted: Wed May 17, 2023 4:26 pm
OK, here's another question.
I have used mamba to set up a python environment for NEURON. If I activate this environment, start python, and import neuron all seems OK.
If, however, I start nrngui and load an old (pre-python) NEURON model and start a ModelView, I get this error:
oc>Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Applications/NEURON/lib/python/neuron/rxd/__init__.py", line 7, in <module>
from . import rxd, constants
File "/Applications/NEURON/lib/python/neuron/rxd/rxd.py", line 2, in <module>
from . import species, node, section1d, region, generalizedReaction, constants
File "/Applications/NEURON/lib/python/neuron/rxd/species.py", line 1, in <module>
from .rxdmath import _Arithmeticed
File "/Applications/NEURON/lib/python/neuron/rxd/rxdmath.py", line 2, in <module>
import numpy
ModuleNotFoundError: No module named 'numpy'
I'm not doing anything with python; why am I getting a python error?
Also, I *do* have numpy installed in this environment, but I'm guessing NEURON is not finding it (maybe it's looking in the base python environment, where nothing is installed?).
I tried setting PYTHONPATH, but either I'm not pointing to the correct location or it's the wrong environment variable.
The larger question: what is the right way to get NEURON to interact properly with a python environment?
Thanks!
I have used mamba to set up a python environment for NEURON. If I activate this environment, start python, and import neuron all seems OK.
If, however, I start nrngui and load an old (pre-python) NEURON model and start a ModelView, I get this error:
oc>Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Applications/NEURON/lib/python/neuron/rxd/__init__.py", line 7, in <module>
from . import rxd, constants
File "/Applications/NEURON/lib/python/neuron/rxd/rxd.py", line 2, in <module>
from . import species, node, section1d, region, generalizedReaction, constants
File "/Applications/NEURON/lib/python/neuron/rxd/species.py", line 1, in <module>
from .rxdmath import _Arithmeticed
File "/Applications/NEURON/lib/python/neuron/rxd/rxdmath.py", line 2, in <module>
import numpy
ModuleNotFoundError: No module named 'numpy'
I'm not doing anything with python; why am I getting a python error?
Also, I *do* have numpy installed in this environment, but I'm guessing NEURON is not finding it (maybe it's looking in the base python environment, where nothing is installed?).
I tried setting PYTHONPATH, but either I'm not pointing to the correct location or it's the wrong environment variable.
The larger question: what is the right way to get NEURON to interact properly with a python environment?
Thanks!