Potrzebuję użyć wersji Python dla wersji Homebrew, a nie wersji systemowej Pythona. Mam czystą instalację macOS Sierra (10.12.5).Instalowanie Homebrew Python i łączenie
Najpierw zainstalowałem homebrew, a następnie zaktualizuję ~/.bash_profile
przy użyciu nano ~/.bash_profile
. Potem dodałem to do pliku:
# Homebrew
export PATH=/usr/local/bin:$PATH
Następnie musiałem ręcznie pozyskać plik ~/.bash_profile
celu zapewnienia zmiany zostały przeładowane użyciu source ~/.bash_profile
.
zainstalowaniu Pythona korzystając brew install python
i starał się połączyć za pomocą brew linkapps python
Wyjście było to:
Warning: Already linked: /usr/local/Cellar/python/2.7.13_1
To relink: brew unlink python && brew link python
Gautams-Air:~ gautam$ which python
/usr/bin/python
Gautams-Air:~ gautam$ python -V
Python 2.7.10
Gautams-Air:~ gautam$ brew linkapps python
Warning: brew linkapps has been deprecated and will eventually be removed!
Unfortunately brew linkapps cannot behave nicely with e.g. Spotlight using
either aliases or symlinks and Homebrew formulae do not build "proper" .app
bundles that can be relocated. Instead, please consider using brew cask and
migrate formulae using .app's to casks.
Linking: /usr/local/opt/python/IDLE.app
Linking: /usr/local/opt/python/Python Launcher.app
Linked 2 apps to /Applications`
Korzystanie which python
wyjście było: /usr/bin/python
Powinno być: /usr/local/bin/python
Próbowałem również przy użyciu: brew unlink python && brew link python
również za pomocą python -V
pokazuje Python 2.7.10
choć obecna wersja w Homebrew jest Python 2.7.13
Jak używać Homebrew wersji Pythona zamiast wersji systemu Pythona? - Jak zrobić linkowanie?
UŻYWAĆ: MacOS Sierra (10.12.5)
[Używanie Pythona z homebrew na OS X] (http://stackoverflow.com/q/25441252) – jww