Page 1 of 1

NRNGUI not working from command line after switch to zsh

Posted: Fri Mar 13, 2020 3:24 pm
by sbrich
Hello all,

I've been preparing to embark upon a new project, learning Python (finally!). In preparation for this I had to do some tweaks to my Terminal in Mac, including switching from the old "bash" to the new "zsh" terminal (whatever that means!).

Now, all my Python, anaconda, etc. seems to be working. However, now when I try to run nrngui from the command line I get the following error:

Code: Select all

zsh: command not found: nrngui
In general NEURON still seems to be working: if I "drag" my init file onto nrngui, everything opens as expected.

I've tried various fixes to potentially change $PATH, as I think this might be the problem... the output of echo $PATH doesn't include any mention of NEURON. But I can't figure out how to change the $PATH in this new terminal environment.

Any help is greatly appreciated!

Scott

Re: NRNGUI not working from command line after switch to zsh

Posted: Sun Mar 15, 2020 10:51 am
by ted
.bash_profile (and sometimes .bashrc) is often used as a place to add things to the PATH on login. Read those to find out where and how NEURON and InterViews were being added to the PATH under bash. Read the documentation of zsh to figure out what you have to do now.

Re: NRNGUI not working from command line after switch to zsh

Posted: Sun Mar 15, 2020 11:28 am
by ramcdougal
Zsh has two things that are roughly equivalent to .bashrc (and .bash_profile): .zshrc and .zshenv (both of these files go in your home folder; they may or may not already be there).

.zshrc is only used by interactive shells, and .zshenv is used by all shells, interactive or not. Thus you probably want to use .zshenv.

You can copy the relevant lines (for setting PATH and PYTHONPATH) from your .bashrc (or .bash_profile) into .zshenv in your home folder. There's also a zsh specific way of setting the PATH, but the regular bash approach works too.

Re: NRNGUI not working from command line after switch to zsh

Posted: Tue Mar 17, 2020 10:30 am
by sbrich
ramcdougal wrote: Sun Mar 15, 2020 11:28 am Zsh has two things that are roughly equivalent to .bashrc (and .bash_profile): .zshrc and .zshenv (both of these files go in your home folder; they may or may not already be there).

.zshrc is only used by interactive shells, and .zshenv is used by all shells, interactive or not. Thus you probably want to use .zshenv.

You can copy the relevant lines (for setting PATH and PYTHONPATH) from your .bashrc (or .bash_profile) into .zshenv in your home folder. There's also a zsh specific way of setting the PATH, but the regular bash approach works too.
Thank you. So just to be clear, I want to add in the commands to set PATH and PYTHONPATH to the .zshenv file, and do so identically to how I would've done so previously in bash?

I'll try this and report back.

Re: NRNGUI not working from command line after switch to zsh

Posted: Tue Mar 17, 2020 11:31 am
by sbrich
ramcdougal wrote: Sun Mar 15, 2020 11:28 am Zsh has two things that are roughly equivalent to .bashrc (and .bash_profile): .zshrc and .zshenv (both of these files go in your home folder; they may or may not already be there).

.zshrc is only used by interactive shells, and .zshenv is used by all shells, interactive or not. Thus you probably want to use .zshenv.

You can copy the relevant lines (for setting PATH and PYTHONPATH) from your .bashrc (or .bash_profile) into .zshenv in your home folder. There's also a zsh specific way of setting the PATH, but the regular bash approach works too.
This worked! I just had to put the correct PATH statement in here. I had previously tried a bunch of other files (.zsh, .zprofile, etc. were ones that I had found online), but never tried .zshenv.

Thanks again!

Re: NRNGUI not working from command line after switch to zsh

Posted: Mon Mar 30, 2020 12:14 pm
by ryang
I'm on a similar journey as the OP, I would like to get all my python code working in Catalina, but I started just trying to get the nrngui command to work in .zsh and have been unsuccessful. I did not have a .zshenv file in my home directory so I created one, but that did not help. I seem to have remnants of NEURON-7.5 around, when I execute 'nrngui' from the command line I get the following:

Code: Select all

➜  ~ nrngui
/Users/ryangrgurich/x86_64/special: line 13: /Applications/NEURON-7.5/nrn/x86_64/bin/nrniv: No such file or directory
I deleted my old version of neuron and installed NEURON-7.7, also the demo file launches, so not sure what's going on. I've been chipping away at this making slow progress. Any help would be greatly appreciated.

Re: NRNGUI not working from command line after switch to zsh

Posted: Wed Apr 01, 2020 2:09 pm
by ramcdougal
Looks like you need to recompile the mod files. It remembers the version of NEURON that was used to compile things.

Re: NRNGUI not working from command line after switch to zsh

Posted: Mon Apr 06, 2020 10:00 pm
by ryang
Shouldn't I be able to just run 'nrngui' from the command line though and get the little window with the run buttons and what not? I was just trying that before I go on to recompiling mod files.

Re: NRNGUI not working from command line after switch to zsh

Posted: Tue Apr 07, 2020 7:45 am
by ramcdougal
No.

nrngui is actually a script that begins by loading the compiled mod files (that's the x86_64/special file), if any, before giving you a prompt.

Re: NRNGUI not working from command line after switch to zsh

Posted: Tue Apr 07, 2020 3:47 pm
by ryang
Thank you! Got a simple hoc file running. I'm super rusty, it's been a good year and a half since I've had my head buried in Neuron.

Re: NRNGUI not working from command line after switch to zsh

Posted: Wed May 27, 2020 5:22 pm
by ryang
I wanted to come back to this topic to mention that I can run nrngui from the command line to launch the Neuron Main Menu. What was happening was what you alluded to, I had an old x86_64 folder in my home directory that wasn't recompiled for the latest neuron version on my system. I even tested out running nrngui from a completely empty directory and the Neuron main menu interface launches.

Best,
Ryan