J'ai fondamentalement la même situation que décrit dans
Python 2.7 on System, PIP and Virtualenv still using 2.6 - How do I switch them to use 2.7Version Pip limbes
C'est, mon Mac utilise Python 2.7 par défaut, alors que Pip installe à 2,6
J'ai suivi Ned Deily's answer et installé easy_install avec mon Python par défaut, et utilisé pour installer Pip.
Maintenant je:
$ which easy_install
/Library/Frameworks/Python.framework/Versions/2.7/bin/easy_install
$ which pip
/Library/Frameworks/Python.framework/Versions/2.7/bin/pip
Bon, en regardant bien. Mais, je reçois aussi ceci:
$ pip --version
pip 1.0.2 from /Library/Python/2.6/site-packages/pip-1.0.2-py2.6.egg (python 2.6)
et Pip est encore installation à 2,6.
Qu'est-ce qui me manque?
Mise à jour:
Peut-être que c'est un clue- que je viens de rencontrer les éléments suivants:
$ ls -la /usr/bin/python*
-rwxr-xr-x 2 root wheel 86000 May 4 2011 /usr/bin/python
-rwxr-xr-x 5 root wheel 925 May 4 2011 /usr/bin/python-config lrwxr-xr-x 1 root wheel 75 May 4 2011 /usr/bin/python2.5 ->
../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5
lrwxr-xr-x 1 root wheel 82 May 4 2011
/usr/bin/python2.5-config ->
../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5-config
lrwxr-xr-x 1 root wheel 75 May 4 2011 /usr/bin/python2.6 ->
../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6
lrwxr-xr-x 1 root wheel 82 May 4 2011
/usr/bin/python2.6-config ->
../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6-config
-rwxr-xr-x 2 root wheel 86000 May 4 2011 /usr/bin/pythonw lrwxr-xr-x 1 root wheel 76 May 4 2011 /usr/bin/pythonw2.5 ->
../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/pythonw2.5
lrwxr-xr-x 1 root wheel 76 May 4 2011 /usr/bin/pythonw2.6 ->
../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/pythonw2.6
et
$ ls -la /usr/local/bin/python*
lrwxr-xr-x 1 ykessler wheel 68
Nov 14 2011 /usr/local/bin/python ->
../../../Library/Frameworks/Python.framework/Versions/2.7/bin/python
lrwxr-xr-x 1 ykessler wheel 71 Nov 14 2011
/usr/local/bin/python-32 ->
../../../Library/Frameworks/Python.framework/Versions/2.7/bin/python-32
lrwxr-xr-x 1 ykessler wheel 75 Nov 14 2011
/usr/local/bin/python-config ->
../../../Library/Frameworks/Python.framework/Versions/2.7/bin/python-config
lrwxr-xr-x 1 ykessler wheel 71 Nov 14 2011
/usr/local/bin/python2.7 ->
../../../Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
lrwxr-xr-x 1 ykessler wheel 74 Nov 14 2011
/usr/local/bin/python2.7-32 ->
../../../Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-32
lrwxr-xr-x 1 ykessler wheel 78 Nov 14 2011
/usr/local/bin/python2.7-config ->
../../../Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
lrwxr-xr-x 1 ykessler wheel 69 Nov 14 2011 /usr/local/bin/pythonw
-> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw
lrwxr-xr-x 1 ykessler wheel 72 Nov 14 2011
/usr/local/bin/pythonw-32 ->
../../../Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw-32
lrwxr-xr-x 1 ykessler wheel 72 Nov 14 2011
/usr/local/bin/pythonw2.7 ->
../../../Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7
lrwxr-xr-x 1 ykessler wheel 75 Nov 14 2011
/usr/local/bin/pythonw2.7-32 ->
../../../Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7-32
Il ressemble à mon environnement utilisateur est pointant vers 2.7, mais l'environnement racine pointant vers 2.6? Comment puis-je réconcilier ces deux?
Mise à jour 2:
OK, juste pour tourner la vis un peu plus:
$ sudo pip --version
pip 1.2.1 from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg (python 2.7)
$ pip --version
pip 1.0.2 from /Library/Python/2.6/site-packages/pip-1.0.2-py2.6.egg (python 2.6)
donc mes points de racines à 2,6 mais sudo pip --version
points pip 2.7, alors que mon l'utilisateur local pointe à 2.7 mais pip --version
points à pip 2.6
??? Mes cerveaux commencent à frire.
Maintenant, je viens de faire sudo pip install {module}
et correctement installé dans 2.7, mais je voudrais savoir ce qui se passait ...
Mise à jour 3: Réponse à la question de Ned:
$ type pip
pip is /Library/Frameworks/Python.framework/Versions/2.7/bin/pip
$ echo $PATH
/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin
$ which pip
/Library/Frameworks/Python.framework/Versions/2.7/bin/pip
$ ls -l $(which pip)
-rwxr-xr-x 1 ykessler admin 358 Oct 3 15:30 /Library/Frameworks/Python.framework/Versions/2.7/bin/pip
$ sudo bash
bash-3.2# type pip
pip is /Library/Frameworks/Python.framework/Versions/2.7/bin/pip
bash-3.2# echo $PATH
/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin
bash-3.2# ls -l $(which pip)
-rwxr-xr-x 1 ykessler admin 358 Oct 3 15:30 /Library/Frameworks/Python.framework/Versions/2.7/bin/pip
ce que python est listé sur 'head/Librar y/Frameworks/Python.framework/Versions/2.7/bin/pip'? –
@Martijn: #!/Bibliothèque/Frameworks/Python.framework/Versions/2.7/Ressources/Python.app/Contents/MacOS/Python – Yarin
Et si vous exécutez '/Bibliothèque/Frameworks/Python.framework/Versions/2.7/bin/pip --version' directement? Votre chemin semble plutôt mucked qu'il trouve encore la version Python 2.6. –