I just downloaded python 2.7 on my mac which runs OS X 10.6.8. The previous version of python installed was 2.6.
When I type python
in the terminal it o
Because my account does not have the admin permission. I work around to set the config in ~/.zshrc
or ~/.bashrc
. Now I give a example that I assume you installed python 3.7. If you installed the other version, just change the version will be fine.
~/.zshrc
solution $ echo "alias python=/usr/local/bin/python3.7" >> ~/.zshrc
$ source ~/.zshrc
~/.bashrc
solution $ echo "alias python=/usr/local/bin/python3.7" >> ~/.bashrc
$ source ~/.bashrc
$ python --version
# print result Python 3.7.1
The other solutions please refer to : https://opensource.com/article/19/5/python-3-default-mac