3

OS:macOS Big Sur 11.1

I have uninstalled python3.8 and python3.9

but my echo $PATH gives:

screenshot of results

I tried to modify path variables by vi ~/.bash_profile, but bash_profile doesn't exist.

I did touch .bash_profile and

export PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"

then source ~/.bash_profile. But after restarting the terminal, echo $PATH has not changed...

How can I delete /Library/Frameworks/Python.framework/Versions/3.8/bin:/Library/Frameworks/Python.framework/Versions/3.9/bin: from my path variables? And which file did this message come from? Is it because I didn't uninstall python completely?

5
  • Have you checked ~/.bashrc file? Commented Feb 2, 2021 at 17:41
  • Are you sure you are running bash at all? Modern versions of macOS use zsh by default. Commented Feb 2, 2021 at 18:26
  • The % is a sure sign that this is, indeed, zsh, as is the title bar of the window. Commented Feb 2, 2021 at 18:30
  • 1
    Look at .zprofile or .zshrc. Commented Feb 2, 2021 at 18:31
  • @YangYushi I chacked . ~/.bashrc does not exist . but /etc/bashrc shows as follow: # System-wide .bashrc file for interactive bash(1) shells. if [ -z "$PS1" ]; then return fi PS1='\h:\W \u\$ ' # Make bash check its window size after a process completes shopt -s checkwinsize [ -r "/etc/bashrc_$TERM_PROGRAM" ] && . "/etc/bashrc_$TERM_PROGRAM" Commented Feb 4, 2021 at 16:13

1 Answer 1

10

bash is no longer the default shell in macOS. The default shell is now zsh; to append to PATH, you should modify ~/.zshrc or ~/.zprofile.

Sign up to request clarification or add additional context in comments.

1 Comment

Awesome!!! I found it in the ~/.zprofile!!! I deleted that file,finally echo $PATH shows /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.