Python formula link to python@3.8 leaves python 3.7 installation unchanged

Originally I have the python formula installed, after python formula lint to python@3.8, Cellar/python/3.7.8/ and its links in /usr/local/bin leaves unchanged, but I can’t remove this python 3.7 copy from homebrew:

$ brew list | grep python
python
python@3.8

I don’t know how fix this, should I reinstall python@3.7 and then remove python@3.7?

1 Like

Is it still called python if you run brew upgrade?

thanks much for your reply, after another run of brew upgrade, python formula and Cellar/python/3.7.8 all disappeared, very good news.
IIRC the last brew upgrade run happened at Jul 8.

@SMillerDev would you like to explain a bit what happened behind the scenes? I have searched homebrew-core repo recent python related history but found nothing … thanks in advance!

It’s basically this: https://github.com/Homebrew/homebrew-core/pull/54912

We migrated the default python to python 3.8.

I have found the commit (56a265eb11) when investigating, but as the date of the commit is May 18, I have thought it has merged long time ago, not recently, didn’t think I should re-run a upgrade.
I guess because homebrew use rebase instead of merge, make it hard to associate a commit with a pull request as there is no info of pull-request with commits, or I don’t know the proper technique to find the PR?

The author date is not always the commit date. You can see when something was committed by running e.g. git log --format=fuller. We use a rebase workflow and only the last commit in a patch series will have pull request information associated with it. You can run git log --reverse 56a265eb11..HEAD and see the Closes #54912 message a few commits later.

Hi, had python 3.7.x installed some time with brew install python. When 3.8.x came up, I installed it with brew install python@3.8. So far so good. My working-horse-Python was 3.7 up to the last update to 3.7.8. When you changed the default python to 3.8 the brew upgrade left my installation confused. brew doctor said that 3.8 is not linked. But linking it makes 3.7.8 unusable for my purposes. brew uninstall python@3.8 leads to dependency failures with other formulae as Midnight Commander and others, which left me concerned. Eventually I found a way to get 3.7 working by manually symlinking it to /usr/local/bin. To make it short, my point is: with all the pip stuff I pip-installed with 3.7, how to I migrate that to 3.8 and then uninstall 3.7 to completely move to 3.8 as my Python default?

You can run pip freeze in the old install and install that list in the new one.

Thanx :grinning:
And what’s about brew switch python ... ? I’m not quite firm in these commands.
3.7.8 is now the active (linked) version an 3.8.3 ist keg-only (unlinked).
BTW: when will pyenv get an upgrade, so Python 3.7.8 will be available from there. Than I can brew uninstall python@3.7 ?

I don’t know when pyenv gets updates but if python@3.8 is keg-only you haven’t updated to the latest version yet.

Again thanx for Your helping!
Eventually I made the final move to 3.8 , which is now linked, and 3.7 ist unlinked an now keg-only :grinning:
Everything went fine and pip install -r requirements.txt was also successful.
brew doctor has no error to report :grinning: