Post Reply 
Need assistance - zsh on Mac to run pyILPer
12-09-2019, 07:10 PM
Post: #1
Need assistance - zsh on Mac to run pyILPer
I recently set up Anaconda and pyILPer on my MacBook Pro, for use with my PILBox and my new-to-me HP-71B.

All was working fine. In my terminal window on my Mac, where I issued the command 'pyilper' to start pyILPer, I kept getting a message from the system that zsh is now the proper shell to be using. I ignored this for a while, but finally broke down and issued the change shell command the system was requesting.

Now, of course, the new zsh does not know anything about pyILPer at all, and I can no longer get it to run.

I am on a MacBook Pro, with the latest Mac OS 10.15.1 Catalina.

Are there any other Mac users who can tell me what in the world I must do to set up a correct path to Anaconda and pyILPer on my Mac?

Thanks very much, in advance, for any thoughts, hints, examples, or whatever might help.

smp
Find all posts by this user
Quote this message in a reply
12-09-2019, 08:15 PM
Post: #2
RE: Need assistance - zsh on Mac to run pyILPer
After quite a bit of searching, I finally found where the pyilper program is located:

/System/Volumes/Data/opt/anaconda3/bin/pyilper

At least now I can invoke pyilper by typing in that path.

smp
Find all posts by this user
Quote this message in a reply
12-09-2019, 09:03 PM (This post was last modified: 12-09-2019 09:36 PM by Sylvain Cote.)
Post: #3
RE: Need assistance - zsh on Mac to run pyILPer
Starting with macOS 10.15 (Catalina) Apple changed the shell from bash to zsh. This mean that the configurations filenames has changed.

Configuration files for bash (Bourne Again Shell) are
  • System files: /etc/profile & /etc/bashrc.
  • User files: ~/.bash_profile, ~/.bash_login, ~/.profile & ~/.bashrc.
Configuration files for zsh (Z Shell) are:
  • System files: /etc/zshenv, /etc/zprofile, /etc/zshrc, /etc/zlogin & /etc/zlogout.
  • User files: ~/.zshenv, ~/.zprofile, ~/.zshrc, ~/.zlogin & ~/.zlogout.
Note: ~ mean your home folder in macOS/Unix/BSD/Linux. (macOS: /Users/YOUR_USER_NAME/)

For some reason Anaconda is still updating one of the bash configuration files (~/.bash_profile or ~/.profile) instead of one of the zsh configurations files (~/.zprofile)

What you need to do is copy the configuration data from the bash configuration file to the zsh configuration file.

The configuration section to copy should look like the following:
Code:
# added by Anaconda3 YYYY.MM installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/Users/YOUR_USER_NAME/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
    \eval "$__conda_setup"
else
    if [ -f "/Users/YOUR_USER_NAME/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/Users/YOUR_USER_NAME/anaconda3/etc/profile.d/conda.sh"
        CONDA_CHANGEPS1=false conda activate base
    else
        \export PATH="/Users/YOUR_USER_NAME/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda init <<<
Note 1: scrolling is needed to completely see the above section
Note 2: do not forget to replace YOUR_USER_NAME by your actual home folder name
Note 3: you will need to start a new shell to apply the updated configuration
Note 4: to see the new configuration, from the command line type: export [RETURN] // you should see the string /Users/YOUR_USER_NAME/anaconda3/bin in your path variable

Sylvain
Find all posts by this user
Quote this message in a reply
12-09-2019, 09:31 PM (This post was last modified: 12-09-2019 09:46 PM by smp.)
Post: #4
RE: Need assistance - zsh on Mac to run pyILPer
Thanks a million, Sylvain!

I'm no power user, by any stretch of the imagination. I'll slowly go through all that you've given me, and try to get this done. If (probably when) I have any questions, I'll post them back here.

Thanks again!

smp

UPDATE:
YES!!! All I needed to do was: cp .bash_profile .zprofile
As you suggested, I logged out of all open Terminal windows, and quit the Terminal.
Then when I did a fresh login to the Terminal, all I have to do is type: pyilper, and up it comes, just like before.

Thank you very much for the details about what's in there and what I needed to do!
Find all posts by this user
Quote this message in a reply
12-09-2019, 10:01 PM (This post was last modified: 12-09-2019 10:03 PM by Sylvain Cote.)
Post: #5
RE: Need assistance - zsh on Mac to run pyILPer
(12-09-2019 09:31 PM)smp Wrote:  YES!!! All I needed to do was: cp .bash_profile .zprofile
Well ... that was not what I was expecting you to do, but I am glad that it worked, I just hope that you did not loose anything in the process.
What I was expecting you to do was, that you open up both files (˜/.bash_profile & ˜/.zprofile) with a text editor, copy & paste the conda init section from the .bash_profile file to the .zprofile file and then save the .zprofile file.
That way you import the conda configuration from the .bash_profile without loosing your current configuration setting in .zprofile.
Sorry if my instructions were not clear enough.
Sylvain
Find all posts by this user
Quote this message in a reply
12-09-2019, 11:10 PM
Post: #6
RE: Need assistance - zsh on Mac to run pyILPer
(12-09-2019 10:01 PM)Sylvain Cote Wrote:  Well ... that was not what I was expecting you to do, but I am glad that it worked, I just hope that you did not loose anything in the process.
What I was expecting you to do was, that you open up both files (˜/.bash_profile & ˜/.zprofile) with a text editor, copy & paste the conda init section from the .bash_profile file to the .zprofile file and then save the .zprofile file.
That way you import the conda configuration from the .bash_profile without loosing your current configuration setting in .zprofile.
Sorry if my instructions were not clear enough.
Sylvain

Your instructions were perfect for me, Sylvain. I checked for all the files you mentioned, and the only one I had was the .bash_profile, and it’s contents were only those put there by Anaconda, like you showed in your post. Since I had no .zprofile at all, I copied the .bash_profile to create one. That got me back to where I was.

Like I said, I’m not an experienced user so I did not have any other setups to be affected.

Thanks again!

smp
Find all posts by this user
Quote this message in a reply
12-10-2019, 12:55 AM
Post: #7
RE: Need assistance - zsh on Mac to run pyILPer
(12-09-2019 07:10 PM)smp Wrote:  I kept getting a message from the system that zsh is now the proper shell to be using. I ignored this for a while, but finally broke down and issued the change shell command the system was requesting.

Don't give in to the zsh zealots? I don't see this on my Mac, I use tcsh for my shell. Is Apple making noises about removing bash? I'd bet a lot of stuff depends on it being there. This is the type of annoying behavior by vendors, forcing changes for no good reason.
Find all posts by this user
Quote this message in a reply
12-10-2019, 03:56 AM
Post: #8
RE: Need assistance - zsh on Mac to run pyILPer
I had forgotten about the whole zsh thing already... After upgrading to Catalina, when I saw that the default shell had changed, a quick Google showed me how to change it back: chsh -s /bin/bash.

It is annoying to get such a change foisted upon you without asking, but I'm not too worried about Apple removing bash altogether. As cruff pointed out, there are far too many shell scripts out there that depend on bash.
Visit this user's website Find all posts by this user
Quote this message in a reply
12-10-2019, 05:54 AM
Post: #9
RE: Need assistance - zsh on Mac to run pyILPer
(12-10-2019 12:55 AM)cruff Wrote:  Don't give in to the zsh zealots? I don't see this on my Mac, I use tcsh for my shell. Is Apple making noises about removing bash? I'd bet a lot of stuff depends on it being there. This is the type of annoying behavior by vendors, forcing changes for no good reason.

There is a good reason: recent shell such as zsh or fish offers lot of stuff bash doesn't.

One can still prefer bash and I do not like zsh complex configuration or how it can becomes slow once you load some extensions or regret that fish implies to change some habits but they are interesting.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)