简体   繁体   中英

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:

结果截图

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?

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM