So basically I tried to make changes to my path in my .bash_profile and save the changes but whenever I restart my terminal, it changes back to the default path and not the one ive set in .bash_profile
Ive tried to use the source ~/.bash_profile command but which i thought helped but somehow, when i restart the terminal, it doesnt change to the settings ive placed in .bash_profile
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"
export PATH
alias python=python3
alias pip=pip3
The expected output is when i type python in mac os terminal it should appear as python 3.7 and not python 2
Put your commands into ~/.zshrc file on macOS Catalina
nano ~/.zshrc
Starting with macOS Catalina, the default interactive shell is zsh:
https://support.apple.com/en-us/HT208050
Make sure that you are using bash as your login shell.
You can check what is your login shell with the command echo $SHELL
. If the result is /bin/bash
, then you are using bash as your login shell. Otherwise you can change it with the command chsh -s /bin/bash
.
I think what you are trying to do should be in .bashrc
file, and not .bash_profile
also maybe your .bashrc
file override those aliases
you can read more about the difference of them here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With