NRNGUI not working from command line after switch to zsh

Post Reply
sbrich
Posts: 29
Joined: Tue May 08, 2018 2:08 pm

NRNGUI not working from command line after switch to zsh

Post 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
ted
Site Admin
Posts: 6287
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

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

Post 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.
ramcdougal
Posts: 267
Joined: Fri Nov 28, 2008 3:38 pm
Location: Yale School of Public Health

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

Post 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.
sbrich
Posts: 29
Joined: Tue May 08, 2018 2:08 pm

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

Post 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.
sbrich
Posts: 29
Joined: Tue May 08, 2018 2:08 pm

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

Post 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!
ryang
Posts: 17
Joined: Wed Mar 21, 2018 6:34 pm

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

Post 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.
ramcdougal
Posts: 267
Joined: Fri Nov 28, 2008 3:38 pm
Location: Yale School of Public Health

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

Post by ramcdougal »

Looks like you need to recompile the mod files. It remembers the version of NEURON that was used to compile things.
ryang
Posts: 17
Joined: Wed Mar 21, 2018 6:34 pm

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

Post 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.
ramcdougal
Posts: 267
Joined: Fri Nov 28, 2008 3:38 pm
Location: Yale School of Public Health

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

Post 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.
ryang
Posts: 17
Joined: Wed Mar 21, 2018 6:34 pm

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

Post 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.
ryang
Posts: 17
Joined: Wed Mar 21, 2018 6:34 pm

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

Post 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
Post Reply