hiavi
hiavi

Reputation: 45

Why is HomeBrew (MacOs) installing Python 3.5.2 instead of Python 3.6.3 (latest as shown on https://www.python.org/downloads/)

I used homebrew to install Python3 and instead of getting Python 3.6.3, I am getting 3.5.2

As per https://www.python.org/downloads/, the latest stable version of Python3 is 3.6.3.

Looks like others hit the same issue as well - see Why can't i install python 3.6 with homebrew?

Can anyone help out with what is going on here?

a-mac:Cellar AB$ brew install python3
Updating Homebrew...
==> Installing dependencies for python3: sqlite, gdbm, openssl
==> Installing python3 dependency: sqlite
==> Downloading https://homebrew.bintray.com/bottles/sqlite-3.20.1.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring sqlite-3.20.1.sierra.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local,
because macOS provides an older sqlite3.

If you need to have this software first in your PATH run:
echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.bash_profile

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/sqlite/lib
    CPPFLAGS: -I/usr/local/opt/sqlite/include

==> Summary
šŸŗ  /usr/local/Cellar/sqlite/3.20.1: 11 files, 3.0MB
==> Installing python3 dependency: gdbm
==> Downloading https://homebrew.bintray.com/bottles/gdbm-1.13.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring gdbm-1.13.sierra.bottle.tar.gz
šŸŗ  /usr/local/Cellar/gdbm/1.13: 19 files, 554.4KB
==> Installing python3 dependency: openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2l.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring openssl-1.0.2l.sierra.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
/usr/local/etc/openssl/certs

and run
/usr/local/opt/openssl/bin/c_rehash

This formula is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and
crypto libraries.

If you need to have this software first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/openssl/lib
    CPPFLAGS: -I/usr/local/opt/openssl/include

==> Summary
šŸŗ  /usr/local/Cellar/openssl/1.0.2l: 1,709 files, 12.2MB
==> Installing python3
==> Downloading https://homebrew.bintray.com/bottles/python3-3.6.3.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring python3-3.6.3.sierra.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/idle3
Target /usr/local/bin/idle3
already exists. You may want to remove it:
rm '/usr/local/bin/idle3'

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

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

Possible conflicting files are:
/usr/local/bin/idle3 -> /Library/Frameworks/Python.framework/Versions/3.5/bin/idle3
/usr/local/bin/pydoc3 -> /Library/Frameworks/Python.framework/Versions/3.5/bin/pydoc3
/usr/local/bin/python3 -> /Library/Frameworks/Python.framework/Versions/3.5/bin/python3
/usr/local/bin/python3-config -> /Library/Frameworks/Python.framework/Versions/3.5/bin/python3-config
/usr/local/bin/pyvenv -> /Library/Frameworks/Python.framework/Versions/3.5/bin/pyvenv
==> /usr/local/Cellar/python3/3.6.3/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-script
==> /usr/local/Cellar/python3/3.6.3/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-script
==> /usr/local/Cellar/python3/3.6.3/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-script
==> Caveats
Pip, setuptools, and wheel have been installed. To update them
pip3 install --upgrade pip setuptools wheel

You can install Python packages with
pip3 install <package>

They will install into the site-package directory
/usr/local/lib/python3.6/site-packages

See: https://docs.brew.sh/Homebrew-and-Python.html
==> Summary
šŸŗ  /usr/local/Cellar/python3/3.6.3: 3,588 files, 56.1MB
a-mac:Cellar AB$ 

When I check for the version of Python installed - here is what I am seeing.

a-mac:Cellar AB$ python --version
Python 2.7.10
a-mac:Cellar AB$ python3 --version
Python 3.5.2

Here is the output from "brew info python3"

a-mac:Environments AB$ brew info python3
python3: stable 3.6.3 (bottled), devel 3.7.0a1, HEAD
Interpreted, interactive, object-oriented programming language
https://www.python.org/
/usr/local/Cellar/python3/3.6.3 (3,588 files, 56.1MB)
Poured from bottle on 2017-10-13 at 23:17:36
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/python3.rb
==> Dependencies
Build: pkg-config āœ˜, sphinx-doc āœ˜
Required: openssl āœ”
Recommended: readline āœ”, sqlite āœ”, gdbm āœ”, xz āœ”
Optional: tcl-tk āœ˜, sphinx-doc āœ˜
==> Options
--with-quicktest
    Run `make quicktest` after the build
--with-sphinx-doc
    Build HTML documentation
--with-tcl-tk
    Use Homebrew's Tk instead of macOS Tk (has optional Cocoa and threads support)
--without-gdbm
    Build without gdbm support
--without-readline
    Build without readline support
--without-sqlite
    Build without sqlite support
--without-xz
    Build without xz support
--devel
    Install development version 3.7.0a1
--HEAD
    Install HEAD version
==> Caveats
Pip, setuptools, and wheel have been installed. To update them
pip3 install --upgrade pip setuptools wheel

You can install Python packages with
pip3 install <package>

They will install into the site-package directory
/usr/local/lib/python3.6/site-packages

See: https://docs.brew.sh/Homebrew-and-Python.html
a-mac:Environments AB$ brew list --pinned
a-mac:Environments AB$ 

Any suggestions as to what could be going wrong here?

Upvotes: 0

Views: 3041

Answers (1)

aaron
aaron

Reputation: 43083

Error: The brew link step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/idle3
Target /usr/local/bin/idle3
already exists. You may want to remove it:
rm '/usr/local/bin/idle3'

HomeBrew installed Python 3.6.3, but could not symlink these files in /usr/local/bin:

Possible conflicting files are:
/usr/local/bin/idle3 -> /Library/Frameworks/Python.framework/Versions/3.5/bin/idle3
/usr/local/bin/pydoc3 -> /Library/Frameworks/Python.framework/Versions/3.5/bin/pydoc3
/usr/local/bin/python3 -> /Library/Frameworks/Python.framework/Versions/3.5/bin/python3
/usr/local/bin/python3-config -> /Library/Frameworks/Python.framework/Versions/3.5/bin/python3-config
/usr/local/bin/pyvenv -> /Library/Frameworks/Python.framework/Versions/3.5/bin/pyvenv

To force the link and overwrite all conflicting files:

brew link --overwrite python3

Upvotes: 1

Related Questions