I am fairly new to python and Neuron, and I need to get Neuron to work alongside python for a lab project I'm starting this week. However, I cannot figure out what I am doing wrong as I cannot have neuron launched in python.
I have Python 3.7.4 32-bit, with the latest version of Neuron (7.7.2 today), installed on Windows 10.
All I did was to download the windows installer from the website, which works since I can launch Neuron by itself without any issue. But when I enter these commands in the command prompt windows :
Code: Select all
python
import neuron
Code: Select all
>>> import neuron
Traceback (most recent call last):
File "c:\nrn\lib\python\neuron\__init__.py", line 106, in <module>
import hoc
ModuleNotFoundError: No module named 'hoc'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\nrn\lib\python\neuron\__init__.py", line 110, in <module>
import neuron.hoc
ModuleNotFoundError: No module named 'neuron.hoc'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "c:\nrn\lib\python\neuron\__init__.py", line 112, in <module>
exec("import neuron.hoc%d%d as hoc" % (sys.version_info[0], sys.version_info[1]))
File "<string>", line 1, in <module>
ImportError: DLL load failed: %1 is not a valid win32 application
I tried checking the paths, and everything, from NEURONHOME to Python Path is correct, I tried installing a previous version of Neuron, I tried changing the "import hoc" line to "from neuron import hoc" inside ___init___.py but the error remains.
Thank you to anyone that took the time to read this and who will hopefully have an idea as to how to fix it.
Best regards.
UPDATE
I just figured out that at the end of the error message something about win32 is written, which got me wondering that maybe (I feel dumb) I should not be running python 32 bit on a 64 bit installation... I then installed Python 64 bit, but now I get yet another different error message:
Code: Select all
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import neuron
Can't load NEURON resources from c:\nrn;/lib/nrn.def[aults]
Failed to setup nrnpy_pr
Failed to setup nrnpy_vec_math
Thank you