2012-04-07 201 views
3

讓我開始說我是編程,mac osx和bash的新手。在mac osx上安裝virtualenvwrapper 10.7.3

我在我的Mac OS X 10.7.3上獲得virtualenvwrapper安裝程序的時間很艱難。 它當然是一個路徑設置問題,但我只是無法正常工作。在.bashrc中

export WORKON_HOME=$HOME/.Apps 
source /usr/local/bin/virtualenvwrapper.sh 

virtualenvwrapper的

設置一些終端輸出:

which easy_install 
/usr/bin/easy_install 

python -V 
Python 2.7.1 

當我運行在終端 「源的.bashrc」 我沒有得到任何輸出。

當我運行在終端mkvirtualenv我得到:

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 1/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 9, in <module> 
    load_entry_point('virtualenv==1.7.1.2', 'console_scripts', 'virtualenv')() 
    File "/Library/Python/2.7/site-packages/virtualenv-1.7.1.2-py2.7.egg/virtualenv.py", line 928, in main 
    never_download=options.never_download) 
    File "/Library/Python/2.7/site-packages/virtualenv-1.7.1.2-py2.7.egg/virtualenv.py", line 1029, in create_environment 
    site_packages=site_packages, clear=clear)) 
    File "/Library/Python/2.7/site-packages/virtualenv-1.7.1.2-py2.7.egg/virtualenv.py", line 1347, in install_python 
    py_executable]) 
    File "/Library/Python/2.7/site-packages/virtualenv-1.7.1.2-py2.7.egg/virtualenv.py", line 966, 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 
+0

重複http://stackoverflow.com/questions/2355188/problem-running-virtualenv-on-mac-os-x – 2012-04-07 15:32:02

回答

2

你可能只需要安裝XCode。它應該是免費的(如果大的話)從App Store下載/安裝。

以供將來參考,我強烈建議使用Python開發的軟件包管理器和PIP(而不是使用easy_install)在OS X上我的首選的軟件包管理器是Homebrew,但MacPortsFink都還不錯。除此之外,點可以讓你卸載東西,easy_install不能簡單的做。

+1

從Xcode 4.3開始,現在只需要爲Xcode安裝更小的命令行工具if您不需要或不需要整個Xcode開發環境。更多細節在這裏:http://kennethreitz.com/xcode-gcc-and-homebrew.html – 2012-04-07 15:07:30

+0

嘿謝謝你的回覆。我已經安裝了Xcode,但我必須安裝命令行工具組件。現在工作正常。多謝你們。 – harristrader 2012-04-07 16:32:05