2

Unable to run python 3.7.2

I'm trying to setup and run server through Django, but I can't seem to make Python 3.7.2 replace Python 2.7.14.

1
  • What does python3 —version tell you? Also see this link.
    – agtoever
    Dec 31, 2018 at 16:03

1 Answer 1

5

Please read the info printed by brew info python. It also links to the Homebrew website on Python, where it says:

The executables are organized as follows so that Python 2 and Python 3 can both be installed without conflict:

  • python3 points to Homebrew’s Python 3.x (if installed)
  • python2 points to Homebrew’s Python 2.7.x (if installed)
  • python points to Homebrew’s Python 2.7.x (if installed) otherwise the macOS system Python. Check out brew info python if you wish to add Homebrew’s 3.x python to your PATH.
  • pip3 points to Homebrew’s Python 3.x’s pip (if installed)
  • pip and pip2 point to Homebrew’s Python 2.7.x’s pip (if installed)

Apparently you have installed both Python 2 and 3 through Hombrew. If you wish for python to point to Python 3 (instead of 2.7), you have to put /usr/local/opt/python/libexec/bin in your PATH before other entries.

You must log in to answer this question.

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