我正在運行macOS Sierra版本10.12.2,並試圖從預裝Python 2.7.10的系統安裝單獨版本的Python。我被建議安裝一個新版本的Python,否則可能會導致系統Python安裝失敗。如何使用brew在Mac OS Sierra上安裝更新的Python?
我使用brew
安裝了Python 2.7.13:
brew install python
但是,我還是終端默認爲系統安裝
$ python
Python 2.7.10 (default, Jul 30 2016, 19:40:32)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
什麼是安裝更新(非的首選方式 - 系統)版本的Python 2.7,並讓操作系統識別並默認使用新的(2.7.13)版本?
編輯:
當我更新.bash_profile
文件,下面,我開始了在bash終端時遇到錯誤。
PATH="/usr/local/Cellar/python/2.7.13/bin:${PATH}"
export "$PATH"
這是錯誤我收到:
-bash: export: `/usr/local/Cellar/python/2.7.13/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin': not a valid identifier
貌似'brew'在'的/ usr /本地/地窖/蟒/ 2.7.13/bin中/ python2.7'安裝蟒 – Borealis