Skip to content Skip to sidebar Skip to footer

Switching Python Version (3.9 → 3.8) Installed By Homebrew

It’s a very similar situation like described here, but vice versa. I have Python 3.8 installed via Homebrew and updated that to 3.9: % brew list --formula | grep python python@3.

Solution 1:

I'm glad you were able to fix the issue your own way, but let me add some advice. Generally speaking, downgrading Python (or really any program) is not usually a supported operation. Upgrading may upgrade dependencies in other packages that are not backwards compatible with older versions of Python or other dependencies. In short, you shouldn't even want to "downgrade" a package, ever.

Instead, you should use multiple independent environments e.g. with virtualenv so that, if ever you need a lower version for some reason, you can replace the entire environment with a new one of lower version (note the subtle difference from "downgrading" because you are using a new environment completely).

Solution 2:

Well, sometimes it helps to ask the question to find the solution on your own – one of the great things of StackOverflow, by the way.

The hint is in the warning of pipenv: "Your Pipfile requires python_version 3.9".

I simply did

rm Pipfile
rm Pipfile.lock

and then it worked:

pipenv install google-ads

Well, at least pipenv worked correctly with Python 3.8. There is still an issue with google-ads, but that's another story.

Probably it would have been enough to change the Pipfile:

[requires]python_version = "3.8"

Post a Comment for "Switching Python Version (3.9 → 3.8) Installed By Homebrew"