Closed cxr001 closed 2 years ago
I can import pyNN.neuron after removing raise Error part in "hclass3.py"(line106 115)
Many thanks for the bug report. It seems there are two issues, here. One is the load_mechanisms
issue, the other seems like it may be due to changes in NEURON. To help debug the latter, would you be able to try using an older version of NEURON (7.x) and let me know what happens?
Yes, if trying NEURON(7.8), the second error will not appear
For load_mechanisms issue, NEURON path use '/', but os.path use \
hi I have same problem with importing pyNN.neuron in windows 10 I have installed neuron 7.8 and 8 by installer with latest version of pyNN by pip command but still I cannot import it and this the error.
numprocs=1 Traceback (most recent call last): File "<stdin>", line 1, in <module> File "D:\Anaconda\envs\brain\lib\site-packages\pyNN\neuron\__init__.py", line 21, in <module> from pyNN.neuron import simulator File "D:\Anaconda\envs\brain\lib\site-packages\pyNN\neuron\simulator.py", line 551, in <module> load_mechanisms(mech_path) # maintains a list of mechanisms that have already been imported File "D:\Anaconda\envs\brain\lib\site-packages\pyNN\neuron\simulator.py", line 72, in load_mechanisms raise IOError("NEURON mechanisms not found in %s. You may need to run 'nrnivmodl' in this directory." % path) OSError: NEURON mechanisms not found in D:\Anaconda\envs\brain\lib\site-packages\pyNN\neuron\nmodl. You may need to run 'nrnivmodl' in this directory.
running nrnivmodl in pyNN/neuron/nmodl dosen't help at all .
what am I doing wrong?
I've tested this with Windows 11, Python 3.10, NEURON 8.2 and the current PyNN master branch, and import pyNN.neuron
works without problems, so I think we've fixed the underlying problem.
Please comment if you're still encountering problems, and I'll reopen the ticket.
After I compiled the "mod" files by mknrndll, the "simulator.py" in pyNN still could not find the right path to load these models. As in Windows, it makes my "nrnmech.dll" is in the same folder as my "mod" files, I rewrite the def load_mechanisms(path) in "simulator.py", add my path manually, as:
So I can load these models. However, I still cannot import pyNN.neuron, it reports a error from "cells.py" as:
TypeError Traceback (most recent call last)