Mountain Lion:VirtualEnv无法创建虚拟环境

时间:2012-10-25 22:58:18

标签: python virtualenv osx-mountain-lion

$ sudo virtualenv test
Password:
Sorry, try again.
Password:
New python executable in test/bin/python
Installing setuptools.............done.
Installing pip....
  Complete output from command /Users/hhimanshu/test/bin/python -x /Users/hhimanshu/test/bin/easy_install /Library/Python/2.7/...ort/pip-1.2.1.tar.gz:
  /Users/hhimanshu/test/bin/python: can't open file '/Users/hhimanshu/test/bin/easy_install': [Errno 2] No such file or directory
----------------------------------------
...Installing pip...done.
Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 8, in <module>
    load_entry_point('virtualenv==1.8.2', 'console_scripts', 'virtualenv')()
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 942, in main
    never_download=options.never_download)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 1054, in create_environment
    install_pip(py_executable, search_dirs=search_dirs, never_download=never_download)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 655, in install_pip
    filter_stdout=_filter_setup)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 1020, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /Users/hhimanshu/test/bin/python -x /Users/hhimanshu/test/bin/easy_install /Library/Python/2.7/...ort/pip-1.2.1.tar.gz failed with error code 2

1 个答案:

答案 0 :(得分:1)

您是如何安装virtualenv的?这适用于我使用显式路径:

sudo /usr/bin/easy_install-2.7 virtualenv
/usr/local/bin/virtualenv-2.7 test