Error Intstalling Python3 on macOS Mojave

0

I'm trying to install python3 on a Mac running macOS Mojave but am running into trouble. First, I updated homebrew and ran the command xcode-select --install. Then, I ran the command brew install python3. Now, I get this error.

Updating Homebrew...
==> Downloading https://homebrew.bintray.com/bottles/python-3.7.3.mojave.bottle.
==> Downloading from https://akamai.bintray.com/25/25e0099852136c4ef1efd221247d0
######################################################################## 100.0%
==> Pouring python-3.7.3.mojave.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/2to3
Target /usr/local/bin/2to3
already exists. You may want to remove it:
  rm '/usr/local/bin/2to3'

To force the link and overwrite all conflicting files:
  brew link --overwrite python

To list all files that would be deleted:
  brew link --overwrite --dry-run python

Possible conflicting files are:
/usr/local/bin/2to3 -> /Library/Frameworks/Python.framework/Versions/3.6/bin/2to3
==> /usr/local/Cellar/python/3.7.3/bin/python3 -s setup.py --no-user-cfg install
==> /usr/local/Cellar/python/3.7.3/bin/python3 -s setup.py --no-user-cfg install
==> /usr/local/Cellar/python/3.7.3/bin/python3 -s setup.py --no-user-cfg install
==> 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/python/libexec/bin

If you need Homebrew's Python 2.7 run
  brew install python@2

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

See: https://docs.brew.sh/Homebrew-and-Python
==> Summary
  /usr/local/Cellar/python/3.7.3: 3,863 files, 59.8MB

So now when I run the command python3 --version, it says the command can't be found. I'm a bit new to mac software as I'm a predominant Windows user so I'm a bit puzzled. What's going on?

P_Locked

Posted 2019-04-26T21:03:42.373

Reputation: 1

Answers

0

You can run in trouble installing Python via Homebrew. In my opinion the better way is to download Python from the official Python Webpage: https://www.python.org/downloads/mac-osx/

Download the 'macOS 64-bit installer' and use the downloaded file to start the installation process. This will generate the correct PATH in your .bash_profile automatically.

By the way, this is the necessary PATH (in .bash_profile):

export PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"

xern

Posted 2019-04-26T21:03:42.373

Reputation: 101