簡體   English   中英

在Mac OS X Sierra上嘗試通過自制程序安裝Python 3失敗

[英]Attempted install of Python 3 via homebrew fails on Mac OS X Sierra

我正在嘗試將python 3與2.7一起安裝在Homebrew上,但收到一條錯誤消息,提示我找不到解決方法。

嘗試brew update && brew install python3 ,出現以下錯誤:

Error: python 2.7.12_2 is already installed
To upgrade to 3.6.4_3, run `brew upgrade python`

我想不理會python 2.7的安裝,這樣我就可以在我的機器上同時訪問Python 2和3了,所以我擔心升級將覆蓋當前的2.7安裝。

我認為我仍然可以使用python.org的程序包執行干凈的並行安裝,但是我想知道為什么會收到此自制錯誤

brew doctor顯示以下包含python的警告

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
  /Library/Frameworks/Python.framework/Versions/2.7/bin/python-config
  /Library/Frameworks/Python.framework/Versions/2.7/bin/python2-config
  /Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config

Warning: Python is installed at /Library/Frameworks/Python.framework

Homebrew only supports building against the System-provided Python or a
brewed Python. In particular, Pythons installed to /Library can interfere
with other software installs.

Warning: Some installed formulae are missing dependencies.
You should `brew install` the missing dependencies:
  brew install python@2 

老實說,我在自己的系統上也擁有Python 3作為默認設置,並且在需要時可以使用Python 2。 使用自制軟件,您可以只更新默認值,因為它需要您執行升級。 這意味着當您運行python ,Python 3將默認運行。

對於Python 2,請安裝brew install python@2 當您想運行Python 2時,只需在終端中運行python2即可。

一旦您通過運行brew鏈接和丟失的鏈接組件來修復斷開的鏈接,Python安裝就會運行。 這些通常不需要SUDO,它們將鏈接在一起,並在它們全部鏈接后運行Brew Doctor。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM