Je dois utiliser la version Homebrew de Python plutôt que la version système de Python. J'ai une nouvelle installation de macOS Sierra (10.12.5). J'ai d'abord installé homebrew, puis mis à jour ~/.bash_profile
en utilisant nano ~/.bash_profile
. Ensuite, je ajouté ceci dans le fichier:Installation de Homebrew Python et de liens
# Homebrew
export PATH=/usr/local/bin:$PATH
Ensuite, je devais lire manuellement le fichier ~/.bash_profile
pour assurer que les modifications ont été rechargées à l'aide source ~/.bash_profile
.
J'ai installé python en utilisant brew install python
et essayé de lier l'aide brew linkapps python
La sortie a été la suivante:
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`
Utilisation which python
la sortie était: /usr/bin/python
Il aurait dû être: /usr/local/bin/python
J'ai aussi essayé en utilisant: brew unlink python && brew link python
également en utilisant python -V
il montre Python 2.7.10
bien que la version actuelle Homebrew est Python 2.7.13
Comment puis-je utiliser la version homebrew de Python au lieu de la version du système de Python? - Comment faire le lien?
UTILISATION: macOS Sierra (10.12.5)
[Utilisation de Python avec homebrew sous OS X] (http://stackoverflow.com/q/25441252) – jww