PyCharm "ModuleNotFoundError: No module named 'neuron'"

Post Reply
sangwonc
Posts: 10
Joined: Sun Nov 07, 2021 7:13 pm

PyCharm "ModuleNotFoundError: No module named 'neuron'"

Post by sangwonc »

Hello,

I am trying to run NEURON on PyCharm, but it produces the following error:
/Users/sangwoncha/PycharmProjects/VGCC_v2/venv/bin/python /Users/sangwoncha/PycharmProjects/VGCC_v2/venv/implement_RXD.py
Traceback (most recent call last):
File "/Users/sangwoncha/PycharmProjects/VGCC_v2/venv/implement_RXD.py", line 1, in <module>
from neuron import h, rxd
ModuleNotFoundError: No module named 'neuron'

Process finished with exit code 1
Previously, I ran NEURON on JupyterLab/Notebook and it worked perfectly fine. I am using an Intel MacBook Pro, which is using BigSur 11.6.2.

Any ideas on how to fix this? I'm relatively new to programming, and if there is any information needed to troubleshoot, I'll do my best to provide them. Thanks
RBJ
Posts: 62
Joined: Sun Aug 02, 2015 4:28 am
Location: UK
Contact:

Re: PyCharm "ModuleNotFoundError: No module named 'neuron'"

Post by RBJ »

I am just a bystander here, but since I do have NEURON (7.6) working well with PyCharm, using an Anaconda environment on one of our Macs, I thought perhaps I would paste up the all important configuration I have:

Script path:

Code: Select all

/Users/richardbarrett-jolley/Documents/NEURON25/model.py
Parameters: None

Environment variables:

Code: Select all

 PYTHONUNBUFFERED=1;PYTHONPATH=/Applications/NEURON-7.6/nrn/lib/python
Python Interpretter:

Code: Select all

Python 3.7 (myNEURON) ~opt/anaconda3/envs/myNEURON/bin/python
Obviously in Anaconda I had previously setup myNEURON as the environment with Numpy etc installed. NEURON itself installed from the binary, NOT pip.

Working Folder:

Code: Select all

/Users/richardbarrett-jolley/Documents/NEURON25
This naturally includes the script and the x86_64 folder populated my mkdll

Then the add source and content roots to PYTHONPATH both ticked.

Hope you can resolve your issue.
Post Reply