Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Brew upgrade python returns "python not installed"

I'm trying to upgrade from "Python 3.7.3" to "Python 3.8" with $ brew upgrade python. But when I try, brew returns:

Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
Updated 2 formulae.

Error: python not installed

I know python is installed because I've been using it for months. I can confirm this by running, which python3

/usr/bin/python3

And python3 --version,

Python 3.7.3

I don't know what is causing this?

Could the issue be that python --version still points to python2, Python 2.7.16.


UPDATE

I also confirm I've run brew cleanup and brew doctor.

brew info python returns

[email protected]: stable 3.8.5 (bottled)
Interpreted, interactive, object-oriented programming language
https://www.python.org/
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/[email protected]
License: Python-2.0
==> Dependencies
Build: pkg-config ✔
Required: gdbm ✔, [email protected] ✔, readline ✔, sqlite ✔, xz ✔
==> Caveats
Python has been installed as
  /usr/local/bin/python3

Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
`python3`, `python3-config`, `pip3` etc., respectively, have been installed into
  /usr/local/opt/[email protected]/libexec/bin

You can install Python packages with
  pip3 install <package>
They will install into the site-package directory
  /usr/local/lib/python3.8/site-packages

See: https://docs.brew.sh/Homebrew-and-Python
==> Analytics
install: 587,815 (30 days), 1,615,984 (90 days), 2,710,078 (365 days)
install-on-request: 187,760 (30 days), 307,168 (90 days), 343,355 (365 days)
build-error: 0 (30 days)

like image 355
tim_xyz Avatar asked May 24 '26 16:05

tim_xyz


1 Answers

The solution was to install python with brew.

brew install python

I assumed it had already been installed, but that was the system (not brew) version.

The error, Error: python not installed implied that python had not been installed with brew.

like image 142
tim_xyz Avatar answered May 26 '26 05:05

tim_xyz