Issue: When I typed python -V
, It gives me python 2.7.16 which is Apple's inbuilt system instead of python3.7
Initially, I followed the below steps and installed the latest python version which is 3.9 and it worked fine perfectly
brew install python
Since I use zsh
by default, I put the following into the .zshrc file:
$ echo "alias python=/usr/local/bin/python3" >> ~/.zshrc
But my project required a python3.7 version so I have uninstalled it using brew uninstall [email protected]
and then installed brew install [email protected]
Also ran echo "alias python=/usr/local/bin/python3" >> ~/.zshrc
But now when try to run python -V
it points to the Python2.7 version not Python 3.7 version
Also check where it is installed
% which pip3
/usr/local/opt/[email protected]/bin/pip3
% which python
/usr/bin/python
% which python3
/usr/local/opt/[email protected]/bin/python3
Need help to fix this issue.