2010-03-01 10 views
14

Estoy usando virtualenv-1.4.5 en Mac OS X 10.6.2 (Xcode está instalado) y Python 2.6. Esto es lo que me pasa cuando se intenta ejecutar un virtualenv ...Problema al ejecutar Virtualenv en 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 

Cualquier sugerencia por qué se está lanzando este error?

Respuesta

1

También hay un error con virtualenv en 10.6 Ver the ticket on virtualenv's bitbucket. Incluso si resuelves el problema que estás teniendo, todavía te encontrarás con otro problema (creo que no se encontró la imagen para Python.framework, pero no recuerdo, no tomé ninguna nota cuando me encontré con esto)

Investigué un poco sobre esto y espero que la raíz del problema se resuelva con Python 2.7. Ciertamente la gente lo conoce y envió un parche a CPython para solucionarlo.

Sin embargo, parece que algunas personas han tenido buenos resultados con 10.6.2 y virtualenv 1.4.5 ... o que ya no usan el sistema Python (macports, build-by-hand).

+0

La URL está rota: "Este repositorio no tiene habilitado el seguimiento de problemas". Este podría ser el boleto en github? https://github.com/pypa/virtualenv/issues/50 –

3

Bueno, el mensaje de error incluye lo siguiente:

debe tener herramientas de desarrollo de Apple instalado

¿verdad? Están en el disco de XCode separado que viene con OSX.

+1

El código dice que no ha instalado Xcode pero dice que sí. ¿Qué dice which install_name_tool en la línea de comando? Debe ser install_name_tool -> install_name_tool ==/usr/bin/install_name_tool – Mark

12

Instale XCode en App Store para solucionar el problema. Tuve el mismo error, instalé XCode, lo ejecuté después de la instalación y ahora virtualenv funciona.

+1

+1 a esto. Fui a AppStore, pagué los $ 5, lo descargué (me confundí por un minuto porque todavía no funcionaba, pero todavía no había ejecutado el instalador, duh). Después de eso, funcionó perfectamente. –

+1

+1 cojo ... actualizado a Lion y tuve que reinstalar xcode para solucionar este problema – Aaron

+0

Acabo de actualizar a lion, y estoy obteniendo ese error también, ¡actualizaré mi xcode y veré qué pasa! –

1

Hay una solución para esto usando el tenedor de virtualenv de @ gregglind. Me contestó con el mismo problema aquí: 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

que tenían los mismos mensajes de error intentar ejecutar virtualenv en una instalación actualizada Max OS X Lion con XCode instalado.

Sin embargo: Mark insinúa on Mar 1 2010:

código bien dice que no se ha instalado Xcode, pero usted dice que tiene. ¿Qué dice which install_name_tool en la línea de comando? Debe ser install_name_tool -> install_name_tool ==/usr/bin/install_name_tool

Tuve el mismo problema. Instalé el último Xcode en 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 

I hizo una simlink de la/Developer/usr/bin a la/usr/bin con

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

Introducción de los 'que' los rendimientos de comando:

$ which install_name_tool 
/usr/bin/install_name_tool 

Después de eso hice la magia 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

agregar install_name_tool a su ruta

export PATH = $ PATH:/desarrollador/usr/bin

24

Todo lo que necesita hacer es instalar las "herramientas de comando de línea" Xcode, hay dos maneras de hacerlo:

1.- Si ya tiene Xcode instalado, vaya a Preferencias -> Descargas y seleccione "Herramientas de línea de comandos".

2.- Descargue las "Herramientas de línea de comandos para Xcode" .dmg desde: https://developer.apple.com/downloads.

Puede instalar Xcode utilizando App Store, pero no incluirá las "Herramientas de línea de comandos" de forma predeterminada.

+0

Esto funcionó para virtualenv y fuera de la caja OS X Lion. ¡Gracias! –

+2

Sí, gran llamada. Tuve este problema después de actualizar de Snow Leopard a Lion. – markdsievers