Installing on Ubuntu 20.04 (GUI not working)

Post Reply
sohaib786
Posts: 16
Joined: Thu Feb 14, 2019 4:31 am

Installing on Ubuntu 20.04 (GUI not working)

Post by sohaib786 »

Hi,
After installing the package I wanted to run the gui for which I wrote in the terminal-

Code: Select all

nrngui -python
This gave the following error-
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2018
See http://neuron.yale.edu/neuron/credits

/home/sohaib/neuron/nrn/x86_64/bin/nrniv: Couldn't find: stdgui.hoc
in /home/sohaib/neuron/nrn/share/nrn/lib/hoc/nrngui.hoc near line 1
{load_file("stdgui.hoc")}
^
/home/sohaib/neuron/nrn/x86_64/bin/nrniv: nrnmainmenu undefined function
in /home/sohaib/neuron/nrn/share/nrn/lib/hoc/nrngui.hoc near line 2
nrnmainmenu()
^
nrnmainmenu()
>>>
What can be a possible solution?

Thanks
ted
Site Admin
Posts: 5810
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Installing on Ubuntu 20.04 (GUI not working)

Post by ted »

After installing the package
Did you do
sudo pip3 install neuron
or did you install from a .deb package?
If you used a .deb package, from where did you get it?
sohaib786
Posts: 16
Joined: Thu Feb 14, 2019 4:31 am

Re: Installing on Ubuntu 20.04 (GUI not working)

Post by sohaib786 »

After using sudo pip3 install neuron, it did the installation(successfully) but didn't work.
This is its location. It is still present.
neuron in /usr/local/lib/python3.8/dist-packages (7.8.1.1)
I then installed using tar.gz file of 7.6.7 version of nrn and iv, which I had downloaded some days back (Now the link is removed)

Code: Select all

For iv
cd ~/neuron/iv
./configure --prefix=`pwd`
make
make install

For nrn
cd ../nrn
./configure --prefix=`pwd` --with-iv=$HOME/neuron/iv --with-paranrn --with-nrnpython=/home/sohaib/anaconda3/envs/lascon/bin/python
make
make install
ted
Site Admin
Posts: 5810
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Installing on Ubuntu 20.04 (GUI not working)

Post by ted »

I then installed using tar.gz file of 7.6.7 version
So what's the current status? Does 7.6.7 work?
sohaib786
Posts: 16
Joined: Thu Feb 14, 2019 4:31 am

Re: Installing on Ubuntu 20.04 (GUI not working)

Post by sohaib786 »

The error which I posted is from 7.6.7.

Code: Select all

from neuron import h
is working. But the GUI doesn't pop up, but it gives the output which I shared in the first post.
ted
Site Admin
Posts: 5810
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Installing on Ubuntu 20.04 (GUI not working)

Post by ted »

If you want to load the GUI,
from neuron import h, gui

or
from neuron import h
h.load_file('nrngui.hoc')

Does that take care of the problem?
ted
Site Admin
Posts: 5810
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Installing on Ubuntu 20.04 (GUI not working)

Post by ted »

Under Mint 19.3 (a Debian/Ubuntu variant) I did a fresh install of NEURON 8.x by executing
pip3 install neuron
as an ordinary user.

However, when I tried checking a mod file for units inconsistencies, I found that the command
modlunit
failed. So did
idraw
but nrniv and nrnivmodl both worked.

modlunit and idraw seemed to exist, but they weren't on my PATH.
locate modlunit returned
/home/ted/.local/lib/python3.6/site-packages/neuron/.data/bin/modlunit
and locate idraw returned
/home/ted/.local/lib/python3.6/site-packages/neuron/.data/bin/idraw

locate nrniv
revealed that something called nrniv was in ~/.local/bin, and ls ~/.local/bin confirmed that files called nrnivmodl, nrngui, and neurondemo were all in that same directory.

Michael Hines suggested that
/home/ted/.local/lib/python3.6/site-packages/neuron/.data/bin/modlunit
and
/home/ted/.local/lib/python3.6/site-packages/neuron/.data/bin/idraw
were "probably supposed to be run from wrapper python scripts from the same folder as nrniv"

Sure enough, ~/.local/bin/nrniv started with the following:
#!/usr/bin/python3
"""
A generic wrapper to access nrn binaries from a python installation
Please create a softlink with the binary name to be called.
"""
etc.
And its contents were identical to the contents of the files called nrnivmod, nrngui, and neurondemo in that directory.

I also checked /home/ted/.local/lib/python3.6/site-packages/neuron/.data/bin/ and found that it contained the "real" NEURON files--not just nrniv, nrnivmodl, nrngui, and neurondemo, but also modlunit, idraw, etc..

So in ~/.local/bin I simply made symbolic links to ~/.local/bin/nrniv and named them modlunit, idraw, etc.. And now I can execute, from any directory, all of the NEURON commands from the command line. Alternatively, instead of making symbolic links, I could have made multiple copies of any one of the wrapper files and given each copy its own name.

Why didn't all of this happen, automatically and correctly, in the first place? Bizarre. Just bizarre. But no more strange and arbitrary than anything in biology.
hines
Site Admin
Posts: 1607
Joined: Wed May 18, 2005 3:32 pm

Re: Installing on Ubuntu 20.04 (GUI not working)

Post by hines »

The issues mentioned by Ted have been fixed and are available with the current neuron-nightly wheel. Also neurondemo should work when the
neuron-nightly wheel is installed in a location for which the user does not have write permission (eg. sudo pip...).
Post Reply