PyNeuron + Ubuntu + Python 3.6

Post Reply
ziemek
Posts: 45
Joined: Thu May 23, 2019 8:02 am
Location: Warsaw, Poland
Contact:

PyNeuron + Ubuntu + Python 3.6

Post by ziemek »

Hi there,

I Try to install neuron for Python on Ubuntu 16.04 and Python 3.6 with command:

Code: Select all

pip install neuron
but I received this error:

Code: Select all

Only Windows and 64-bit Linux currently supported by PyNEURON
The error is strange since I have 64-bit Ubuntu.

Then I tried with:

Code: Select all

pip install pyneuron
and now the error is this:

Code: Select all

Only Windows OS is currently supported by PyNEURON
EDIT:
I discovered that pip installation works for PyNeuron version <= 7.2.536.4. But if you just try to install the newest version (7.2.536.8) it fails.

But the library not works because it's code seems to be Python 2.7 - neuron/__init__.py file example (take a look at print):

Code: Select all

# Configure NEURONHOME
for p in POSSIBLE_HOME_PATH:
    neuronhome = p
    if os.path.isdir(neuronhome) == False:
        print "Could not find NEURONHOME at", neuronhome
    else:
        break
        
Since I assume that most of people use Linux OS and Python 3.x those errors are quite unusual. I will be very glad for any help :)
ted
Site Admin
Posts: 6287
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: PyNeuron + Ubuntu + Python 3.6

Post by ted »

If you're having problems with PyNeuron, ask the developer of PyNeuron for help.

NEURON's license allows third parties to fork their own project from it, and create whatever they want with it. But they're responsible for supporting what they create.

If you need to use NEURON, you should completely uninstall PyNeuron, then download and install the latest version of NEURON from www.neuron.yale.edu
ziemek
Posts: 45
Joined: Thu May 23, 2019 8:02 am
Location: Warsaw, Poland
Contact:

Re: PyNeuron + Ubuntu + Python 3.6

Post by ziemek »

Thank's for quick answer, but is there any supported way to use NEURON with Python?

Well, at least according to this simple QuickStart: https://www.neuron.yale.edu/ftp/neuron/ ... kstart.pdf after a fresh NEURON installation Python libs should just work, but not for me since I have:

Code: Select all

>>> from neuron import h
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'neuron'
So I assume that I can just add libs by hand to the PYTHONPATH, but could you tell me where I can find them and do I need to install anything before?
ted
Site Admin
Posts: 6287
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: PyNeuron + Ubuntu + Python 3.6

Post by ted »

Install NEURON.

If your program makes use of NEURON's GUI or standard run system, make sure that its main Python file (the one you call to launch your model/simulation) starts with the line
from neuron import h, gui
If it doesn't, that file should start with the line
from neuron import h

Then at the Linux system prompt, launch python 3.6 with the name of your program's main Python file as the argument.

For more information, see
https://neuron.yale.edu/neuron/docs/scr ... ron-basics
ziemek
Posts: 45
Joined: Thu May 23, 2019 8:02 am
Location: Warsaw, Poland
Contact:

Re: PyNeuron + Ubuntu + Python 3.6

Post by ziemek »

Well obviously I did it after a fresh installation of NEURON Python couldn't find the neuron library, that's the problem. I use Anaconda, but it shouldn't be an issue.

After I downloaded the source code from the github, compile it and then install nrnpython by hand - it finally started to work :)

But still I'm curious why it doesn't work by default from the fresh NEURON installation. By the way - this situation reminds me that I already had the same issue on my home computer in the past with Ubuntu 16.04 and Anaconda with Python 3.5 as well. So don't you think it's a systematic problem, maybe for users who already have Anaconda and then install NEURON from deb package?
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: PyNeuron + Ubuntu + Python 3.6

Post by hines »

So I assume that I can just add libs by hand to the PYTHONPATH, but could you tell me where I can find
export PYTHONPATH=/where/you/installed/nrn/lib #often /usr/local/nrn/lib
The default build installs the NEURON module in <prefix>/lib/python in order to be python independent of the python version.
It would be nice if the installer gives a choice about this.
Post Reply