Python version - not the latest installed version

I’m new to using Homebrew, and I’ve gone through the steps to install homebrew and the latest version of Python 3.7.5.

I’ve installed Python 3.7.5, but when I ask which version I’m using, using brew python version, I get the response that I’m still using 3.6.4 (something I must have installed before).

Can anyone explain why? Can anyone provide a link to how to delete anything python and home-brew related, and start from scratch so that I can be clean and up to date?

I’m a beginner to this, so please be gentle!

What does brew info python tell you? It should say the version is 3.7.5. If that isn’t the case, do brew update-reset && brew upgrade.

If it is the case, run which python and echo $PATH and post the output here.

Thanks. If I use brew info python, it does tell me that I have python 3.7.5, along with a lot of information and a few warnings, that I have unbrewed dylibs, some config files found outside my system or homebrew directories, as well as unbrewed header files, unbrewed .pc files and unbrewed static static libraries.

Running which python gives me /usr/bin/python

Echo $PATH gives me `/Library/Frameworks/Python.framework/Versions/3.6/bin:/anaconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin`

I had used Anaconda, and I wanted to start afresh with homebrew as recommended.

Thanks for your help.

If you want to use the homebrew version you need to put /usr/local/bin in your path before everything else.

How does one do that? Do I need to delete the reference to Anaconda, or does it go before?

Thanks.

I’d delete the reference to anaconda alltogether. https://docs.anaconda.com/anaconda/install/uninstall/ documents this too. But editing your ~/.bashrc or ~/.zshrc to have /usr/local/bin first in the PATH isn’t a bad idea either.

Thanks, that seems to work! Thanks for your help. I’m new to this, so quite slow and have to google a lot.

Sorry, it doesn’t seem to work. Could you please explain what I need to do to change the PATH please? It did seem to work temporarily, but again, it’s back to 3.6. I’ve uninstalled homebrew and python, reinstalled, etc.