Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

macOS: How to change PATH environment variable?

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?

like image 718
Rockin Avatar asked Apr 11 '26 14:04

Rockin


1 Answers

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.

like image 120
Richard Barber Avatar answered Apr 13 '26 02:04

Richard Barber



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!