9

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)

5
  • 5
    python not installed means Python wasn't installed by homebrew. Commented Aug 21, 2020 at 15:25
  • 1
    What does brew info python have to say? Commented Aug 21, 2020 at 15:28
  • @khelwood This is a reasonably new mac machine, and I think I've only used homebrew. I guess it's possible I accidently installed without it... Commented Aug 21, 2020 at 15:28
  • @MisterMiyagi I've added what brew info python returns above. TBH, it's beyond my comprehension. Commented Aug 21, 2020 at 15:31
  • 1
    The important part is the Not installed line. Please install it before trying to upgrade it. Commented Aug 21, 2020 at 15:32

2 Answers 2

9

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.

Sign up to request clarification or add additional context in comments.

Comments

-1

In https://discuss.python.org/t/updating-python-under-usr-bin-python3/13020 python developer recommends avoid touching the system Python (/usr/bin/pythonX), and install your own copy (via Python.org , Homebrew, Anaconda, etc).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.