2011-09-22 61 views
3

嘗試使用virutalenv版本1.6.4(最新的在寫這篇文章)的10.7,獅子從Mac App Store的安裝是的Xcode 4的,但我得到了以下錯誤消息:無法調用install_name_tool

New python executable in SUPENV/bin/python 
Error [Errno 2] No such file or directory while executing command install_name_tool -change /System/Library/Fram.../Versions/2.7/Python @executable_path/../.Python SUPENV/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.6.4', 'console_scripts', 'virtualenv')() 
    File "/Library/Python/2.7/site-packages/virtualenv-1.6.4-py2.7.egg/virtualenv.py", line 810, in main 
never_download=options.never_download) 
    File "/Library/Python/2.7/site-packages/virtualenv-1.6.4-py2.7.egg/virtualenv.py", line 901, in create_environment 
site_packages=site_packages, clear=clear)) 
    File "/Library/Python/2.7/site-packages/virtualenv-1.6.4-py2.7.egg/virtualenv.py", line 1166, in install_python 
py_executable]) 
    File "/Library/Python/2.7/site-packages/virtualenv-1.6.4-py2.7.egg/virtualenv.py", line 843, in call_subprocess 
cwd=cwd, env=env) 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__ 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child 
OSError: [Errno 2] No such file or directory 

如何解決這個問題的任何提示...我想第一是檢查是否install_name_tool存在我的系統上,然後用力的virtualenv使用它...

在此先感謝!

回答

4

您是否確實安裝了Xcode 4?從App Store下載它只會爲其下載安裝程序。然後你需要運行安裝程序;你應該找到安裝程序下載到/Applications。你運行它之後,你應該在這裏找到install_name_tool

$ which install_name_tool 
/usr/bin/install_name_tool 
+0

好吧有人覺得有點傻。 ;)謝謝奈德! – Jay

+0

你不是第一個也不是最後一個! *它有點令人驚訝,它不會自行安裝。 –

10

必須同時安裝了XCode,運行它,並選擇可選的「命令行工具」包,然後安裝這些。更詳細地:從App Store

    • 下載的XCode運行從
    • 選擇XCode->首選項,然後選擇「下載」選項卡
    • 單擊應用程序或啓動板下載的二進制的XCode 「命令行工具」選擇並安裝它們
  • 0

    使用新版本的virtualenv(至少從1.8.4開始),不再需要從Xcode安裝「命令行工具」包。