Cannot Import Neuron Module into PyCharm

Answered

I am having a problem importing a module name Neuron into PyCharm. I am running MacOS Sierra.

 

"~ which python" in the terminal generates the output:

 

/Users/billycarson/anaconda/bin/python

 

Showing that I'm using Anaconda 2.7 as the default Python. Entering the commands:

 

python

import neuron

 

into the terminal returns the output:

 

Python 2.7.13 |Anaconda custom (x86_64)| (default, Dec 20 2016, 23:05:08)

[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

Anaconda is brought to you by Continuum Analytics.

Please check out: http://continuum.io/thanks and https://anaconda.org

 

NEURON -- VERSION 7.4 (1380:90539e842093) 90539e842093

Duke, Yale, and the BlueBrain Project -- Copyright 1984-2015

See http://www.neuron.yale.edu/neuron/credits

 

So this shows that Python can import the module Neuron. I checked which Python I was using as my PyCharm project interpreter and it was Anaconda 2.7. However, when I type "from neuron import h, gui" into a script and run said script, PyCharm returns an error saying "No module named neuron".

 

What am I doing wrong/how can I fix this problem? Why does Python/Anaconda recognize the module but PyCharm does not?

4 comments

Hello,

> PyCharm returns an error saying "No module named neuron"

Could you please attach a screenshot that shows the problem? Thank you.

0

Hi William! Could you please specify the way you installed neuron? Did you use .pkg file from official website?

0

I installed NEURON from source initially, and I got the same error mentioned so I most recently tried installing from the .pkg file from the website to see if it would fix the error but it did not. The .pkg installation is the current installation

0

Please sign in to leave a comment.