2010-03-01 6 views
14

J'utilise virtualenv-1.4.5 sous Mac OS X 10.6.2 (Xcode est installé) et Python 2.6. Voici ce que je reçois quand je tente d'exécuter un virtualenv ...Problème lors de l'exécution de Virtualenv sous Mac OS X

Mac-Pro:pylonsdev paul$ virtualenv --no-site-packages -v trythis 
Creating trythis/lib/python2.6 
Symlinking Python bootstrap modules 
    Symlinking trythis/lib/python2.6/_abcoll.pyc 
    Symlinking trythis/lib/python2.6/_abcoll.pyo 
    Symlinking trythis/lib/python2.6/abc.pyc 
    Symlinking trythis/lib/python2.6/abc.pyo 
    Symlinking trythis/lib/python2.6/codecs.pyc 
    Symlinking trythis/lib/python2.6/codecs.pyo 
    Symlinking trythis/lib/python2.6/config 
    Symlinking trythis/lib/python2.6/copy_reg.pyc 
    Symlinking trythis/lib/python2.6/copy_reg.pyo 
    Symlinking trythis/lib/python2.6/encodings 
    Symlinking trythis/lib/python2.6/fnmatch.pyc 
    Symlinking trythis/lib/python2.6/fnmatch.pyo 
    Symlinking trythis/lib/python2.6/genericpath.pyc 
    Symlinking trythis/lib/python2.6/genericpath.pyo 
    Symlinking trythis/lib/python2.6/lib-dynload 
    Symlinking trythis/lib/python2.6/linecache.pyc 
    Symlinking trythis/lib/python2.6/linecache.pyo 
    Symlinking trythis/lib/python2.6/locale.pyc 
    Symlinking trythis/lib/python2.6/locale.pyo 
    Symlinking trythis/lib/python2.6/ntpath.pyc 
    Symlinking trythis/lib/python2.6/ntpath.pyo 
    Symlinking trythis/lib/python2.6/os.pyc 
    Symlinking trythis/lib/python2.6/os.pyo 
    Symlinking trythis/lib/python2.6/posixpath.pyc 
    Symlinking trythis/lib/python2.6/posixpath.pyo 
    Symlinking trythis/lib/python2.6/re.pyc 
    Symlinking trythis/lib/python2.6/re.pyo 
    Symlinking trythis/lib/python2.6/sre.pyc 
    Symlinking trythis/lib/python2.6/sre.pyo 
    Symlinking trythis/lib/python2.6/sre_compile.pyc 
    Symlinking trythis/lib/python2.6/sre_compile.pyo 
    Symlinking trythis/lib/python2.6/sre_constants.pyc 
    Symlinking trythis/lib/python2.6/sre_constants.pyo 
    Symlinking trythis/lib/python2.6/sre_parse.pyc 
    Symlinking trythis/lib/python2.6/sre_parse.pyo 
    Symlinking trythis/lib/python2.6/stat.pyc 
    Symlinking trythis/lib/python2.6/stat.pyo 
    Symlinking trythis/lib/python2.6/types.pyc 
    Symlinking trythis/lib/python2.6/types.pyo 
    Symlinking trythis/lib/python2.6/UserDict.pyc 
    Symlinking trythis/lib/python2.6/UserDict.pyo 
    Symlinking trythis/lib/python2.6/warnings.pyc 
    Symlinking trythis/lib/python2.6/warnings.pyo 
Creating trythis/lib/python2.6/site-packages 
Writing trythis/lib/python2.6/site.py 
Writing trythis/lib/python2.6/orig-prefix.txt 
Writing trythis/lib/python2.6/no-global-site-packages.txt 
Creating parent directories for trythis/include 
Symlinking trythis/include/python2.6 
Creating trythis/bin 
New python executable in trythis/bin/python 
Changed mode of trythis/bin/python to 0755 
Symlinking trythis/.Python 
Error [Errno 2] No such file or directory while executing command install_name_tool -change /System/Library/Frameworks/Pyt...ython @executable_path/../.Python trythis/bin/python 
Could not call install_name_tool -- you must have Apple's development tools installed 
Traceback (most recent call last): 
    File "/usr/local/bin/virtualenv", line 8, in <module> 
    load_entry_point('virtualenv==1.4.5', 'console_scripts', 'virtualenv')() 
    File "/Library/Python/2.6/site-packages/virtualenv-1.4.5-py2.6.egg/virtualenv.py", line 529, in main 
    use_distribute=options.use_distribute) 
    File "/Library/Python/2.6/site-packages/virtualenv-1.4.5-py2.6.egg/virtualenv.py", line 612, in create_environment 
    site_packages=site_packages, clear=clear)) 
    File "/Library/Python/2.6/site-packages/virtualenv-1.4.5-py2.6.egg/virtualenv.py", line 806, in install_python 
    py_executable]) 
    File "/Library/Python/2.6/site-packages/virtualenv-1.4.5-py2.6.egg/virtualenv.py", line 557, in call_subprocess 
    cwd=cwd, env=env) 
    File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 595, in __init__ 
    File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1106, in _execute_child 
OSError: [Errno 2] No such file or directory 

Aucune suggestion indiquant pourquoi cette erreur est générée?

Répondre

1

Il y a aussi un bug avec virtualenv sur 10.6 Voir the ticket on virtualenv's bitbucket. Même si vous résolvez le problème que vous rencontrez, vous rencontrerez toujours un autre problème (je pense que l'image n'a pas été trouvée pour Python.framework, mais je ne m'en souviens pas - je n'ai pris aucune note quand j'ai rencontré ça)

J'ai fait des recherches sur ceci et j'espère que la racine du problème sera résolue avec Python 2.7 - certainement les gens le savent, et ont soumis un correctif à CPython pour le réparer.

Cependant, il semble que certaines personnes ont eu de bons résultats avec 10.6.2 et virtualenv 1.4.5 ... ou ne plus utiliser le système Python (macports, build-by-hand).

+0

L'URL est rompue: "Ce référentiel n'a pas de suivi de problème activé." Cela pourrait être le ticket sur github? https://github.com/pypa/virtualenv/issues/50 –

3

Eh bien, le message d'erreur comprend ceci:

vous devez disposer d'outils de développement d'Apple installé

-vous? Ils sont sur le disque XCode séparé fourni avec OSX.

+1

Le code de puits indique que vous n'avez pas installé Xcode, mais vous dites que vous l'avez. Que dit quel nom_install_tool à la ligne de commande? Il devrait être install_name_tool -> install_name_tool ==/usr/bin/install_name_tool – Mark

12

Installez XCode depuis l'App Store pour résoudre le problème. J'ai eu la même erreur, installé XCode, l'ai couru après l'installation, et maintenant virtualenv fonctionne.

+1

+1 à cela. Je suis allé à l'AppStore, j'ai payé les 5 $, je l'ai téléchargé (j'étais confus pendant une minute parce que ça ne fonctionnait toujours pas, mais je n'avais pas encore lancé l'installateur, duh). Après cela, a parfaitement fonctionné. –

+1

+1 lame ... mis à jour à Lion et a dû réinstaller xcode pour résoudre ce problème – Aaron

+0

Je viens de mettre à jour à lion, et je reçois cette erreur aussi, va mettre à jour mon xcode et voir ce qui se passe! –

1

Il existe une solution pour cela en utilisant fork de virtualenv @ gregglind. Je lui ai répondu au même problème: mac osx: unable to use virtualenv

git clone https://github.com/gregglind/virtualenv.git 
cd virtualenv 
git checkout feature/install_name_tool 
sudo python setup.py install 
3

J'ai eu les mêmes messages d'erreur en essayant d'exécuter virtualenv sur une mise à jour l'installation Max OSX Lion avec XCode installé.

Cependant Physiquement: Mark on Mar 1 2010:

code bien dit que vous n'avez pas installé Xcode mais vous dites que vous avez. Que dit quel nom_install_tool à la ligne de commande? Il devrait être install_name_tool -> install_name_tool ==/usr/bin/install_name_tool

J'ai eu le même problème. J'avais installé le dernier Xcode dans Lion (10.7.2).

$ locate install_name_tool 
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/install_name_tool 
/Developer/usr/bin/install_name_tool 
/Developer/usr/share/man/man1/install_name_tool.1 

J'ai fait une simlink du/développeur/usr/bin dans le répertoire/usr/bin avec

$ sudo ln -s /Developer/usr/bin/install_name_tool /usr/bin/install_name_tool 

Saisie des 'qui' donne de commande:

$ which install_name_tool 
/usr/bin/install_name_tool 

Après cela Je l'ai fait la magie virtualenv

$ virtualenv -p python2.6 myvirtenv 
Running virtualenv with interpreter /opt/local/bin/python2.6 
New python executable in myvirtenv/bin/python 
Installing setuptools............................done. 
Installing pip...............done. 
0

ajouter install_name_tool à votre chemin

export PATH = $ PATH:/Développeur/usr/bin

24

Tout ce que vous avez vraiment besoin de faire est d'installer les "Outils de ligne de commande" Xcode, il y a deux façons de le faire: 1. Si vous avez déjà installé Xcode, allez dans Préférences -> Téléchargements et sélectionnez "Outils de ligne de commande".

2.- Téléchargez le "Outils de ligne de commande pour Xcode" .dmg de: https://developer.apple.com/downloads.

Vous pouvez installer Xcode en utilisant l'App Store, mais il n'inclut pas les "Outils de ligne de commande" par défaut.

+0

Cela a fonctionné pour virtualenv et out-of-the-box OS X Lion. Merci! –

+2

Oui, bon appel. J'ai eu ce problème après la mise à niveau de Snow Leopard à Lion. – markdsievers