0

I have manually downloaded the latest python upgrade - 3.9.6, however when I check the version of python on my terminal (iMac - big Sur):

-iMac ~ % python --version
Python 3.8.8

However, when I try to upgrade my python using home-brew:

 ~ % brew upgrade python
Warning: python 3.9.5 already installed

I seem to not have the one that I downloaded - python 3.9.6. Is there a way to remove these other python languages i.e. 3.8.8, 3.9.5 and just keeping the latest python 3.9.6?

2
  • 1
    It would be safer if you did not go down along that path. Removing your os' base python install because you are not happy with its version, only to try to replace it with a newer shinier version is the perfect recipe forr the perfect package storm awaiting you. Just wait patiently for your package manager to install the newer version of Python you seem to desire. In other brew knows what it's doing. Just don't second guess it. ;-) Ha ! And if you keep having "latest-version envy" go to a good Linux rolling release. One is Archlinux. It offers you the best doc all around on the planet.
    – Cbhihe
    Commented Jul 3, 2021 at 10:32
  • 1
    And just to be fair, if the problem is not just wanting but instead needing the Python version you mentionned, then install yourself a virtual Python environment and install it there. That however would be for another question. :-))
    – Cbhihe
    Commented Jul 3, 2021 at 10:36

1 Answer 1

0

There's multiple versions of Python on your system. Don't worry, that's not a problem as long as your system doesn't confuse anything.

With which python you'll find where your 3.8.8 resides. It might be a system thing that you really can't uninstall without breaking something else.

But you don't need to: within the reach of brew, there's an installed 3.9.5 somewhere – probably under /usr/local/bin. However, there's this older python binary somewhere in your path.

The easiest way around is actually calling python3.9. If that doesn't work, check that your $PATH includes /usr/local/bin.

If for some applications, you must have python3 actually be the brew-supplied python 3.9, then you must export PATH=/usr/local/bin:$PATH in a shell from which you start that application, so that your system looks in the brew installation folders first. You can change the path globally to start with /usr/local/bin, but I do not recommend it – that's a recipe for things not working anymore, because your system might well depend on the OS X version of tools.

2
  • MarcusMiller: (1) I don't quite get what you are getting at with your answer. You say it's ok, don't worry, when it's not ok and the asker should worry. (2) pyenv or virtualenv or whatever applies to MacOS is perhaps the better solution, although virtual environments may be out of the asker's league. If so they need to tell us. 3) "Stop and do nothing!!" is probably the best advice in this case as the asker seems unaware of what messing with base packages may cause. 4) You seem to assume that the downloaded Python is installed. It's probably not installed.
    – Cbhihe
    Commented Jul 3, 2021 at 14:49
  • @Cbhihe (1) the asker does not have to worry. Everything is alright – they just need to use the python they installed and want. (2) is kind of orthogonal, as brew does exactly that: install python to a prefix Commented Jul 3, 2021 at 15:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .