为什么HomeBrew(MacO)安装Python 3.5.2而不是Python 3.6.3(最新版本如https://



我使用自制软件安装Python3,而不是获得Python3.6.3,而是获得3.5.2

根据https://www.python.org/downloads/,Python3的最新稳定版本是3.6.3。

看起来其他人也遇到了同样的问题-请参阅为什么可以';我用自制软件安装python 3.6吗?

有人能帮忙解决这里发生的事情吗

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$ 

当我检查安装的Python版本时,以下是我看到的

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

这是"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$ 

关于这里可能出了什么问题,有什么建议吗?

错误:brew link步骤未成功完成
已生成但未符号链接到/usr/local的公式
无法符号链接bin/inidle3
目标/usr/local/bin/idle3
已存在。您可能需要删除它:
rm'/usr/local/bin/idle3'

HomeBrew安装了Python 3.6.3,但无法在/usr/local/bin:中符号链接这些文件

可能存在冲突的文件有:
/usr/local/bin/idle3->/Library/Frameworks/Python.framework/Versions/3.5/bin/idler3
/usribrary/Frameworks/python3->/Library/Frameworks/Pythn.framework/Versions/3.5/bin/python3/Library/Frameworks/Python.framework/Versions/3.5/bin/python3配置
/usr/local/bin/pyvenv->/Library/Frameworks/Pythn.framework/Versions/3.5.bin/pyvenv

强制链接并覆盖所有冲突文件:

brew link --overwrite python3

最新更新