当山狮ex mkvirtualenv出错 [英] Error when ex mkvirtualenv in Mountain Lion

查看:163
本文介绍了当山狮ex mkvirtualenv出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有山狮,我使用这种方法安装了virtualenv:

  sudo easy_install pip 
sudo pip install virtualenv virtualenvwrapper
echoexport WORKON_HOME = $ HOME / Envs>> $ BASH_CONFIG_FILE
echosource /usr/local/bin/virtualenvwrapper.sh>>> $ BASH_CONFIG_FILE
source〜/ .bashrc

当我尝试创建virtualenv这个命令:

  mkvirtualenv test 

我收到此错误:

 新的python可执行文件在test / bin / python 
安装setuptools ...........
从命令/用户/ marco / Envs / test / bin / python -c#!python
\\完成输出\Bootstr ... sys.argv [1:])

/Library/Python/2.7/...ols-0.6c11-py2.7.egg:
追踪(最近的最后一次呼叫):
文件< string>,第279行,< module>
文件< string>,第207行,主
文件/Library/Python/2.7/site-packages/virtualenv_support/setuptools-0.6c11-py2.7.egg/setuptools/__init__.py,第2行< module>
文件/ Library / Python /2.7/site-packages/virtualenv_support/setuptools-0.6c11-py2.7.egg/setuptools/extension.py,第一行<模块>
文件/ Users / marco / En vs / test / lib / python2.7 / distutils / __ init__.py,第16行在< module>
exec(open(os.path.join(distutils_path,'__init __。py'))。read())
IOError:[Errno 2]没有这样的文件或目录:'/ System / Library /框架/ Python.framework /版本/ 2.7 / lib / python2.7 / distutils / __ init__.py'
------------------------ ----------------
...安装setuptools ...完成。
追溯(最近的最后一次呼叫):
文件/ usr / local / bin / virtualenv,第8行,< module>
load_entry_point('virtualenv == 1.7.2','console_scripts','virtualenv')()
文件/Library/Python/2.7/site-packages/virtualenv.py,第942行,在
中,never_download = options.never_download)
文件/Library/Python/2.7/site-packages/virtualenv.py,第1052行,在create_environment中
search_dirs = search_dirs,never_download = never_download )
文件/Library/Python/2.7/site-packages/virtualenv.py,第598行,在install_setuptools
search_dirs = search_dirs,never_download = never_download)
文件/ Library / Python /2.7/site-packages/virtualenv.py,第570行,在_install_req
cwd = cwd)
文件/Library/Python/2.7/site-packages/virtualenv.py,第1020行,在call_subprocess
%(cmd_desc,proc.returncode))
OSError:Command / Users / marco / Envs / test / bin / python -c#!python
\\ \Bootstr ... sys.argv [1:])
/Library/Python/2.7/...ols-0.6c11-py2.7.egg失败,出现错误代码1

你能帮我吗?



谢谢!
标记

解决方案

您没有安装setuptools ,



这里



如果您从狮子升级到山狮,则由于文件系统中的某些更改,python安装已损坏,理想情况下,您应该从xcode安装命令行工具,然后从python网站安装python,然后从python网站安装工具,然后通过easy_install进行安装,所有操作都将在以后工作。


I have Mountain Lion and I installed virtualenv using this method:

sudo easy_install pip
sudo pip install virtualenv virtualenvwrapper
echo "export WORKON_HOME=$HOME/Envs" >> $BASH_CONFIG_FILE
echo "source /usr/local/bin/virtualenvwrapper.sh" >> $BASH_CONFIG_FILE
source ~/.bashrc

There is a problem when I try to create the virtualenv with this command:

mkvirtualenv test

I receive this error:

New python executable in test/bin/python
Installing setuptools...........
Complete output from command /Users/marco/Envs/test/bin/python -c "#!python
\"\"\"Bootstra...sys.argv[1:])

" /Library/Python/2.7/...ols-0.6c11-py2.7.egg:
Traceback (most recent call last):
File "<string>", line 279, in <module>
File "<string>", line 207, in main
File "/Library/Python/2.7/site-packages/virtualenv_support/setuptools-0.6c11-py2.7.egg/setuptools/__init__.py", line 2, in <module>
File "/Library/Python/2.7/site-packages/virtualenv_support/setuptools-0.6c11-py2.7.egg/setuptools/extension.py", line 1, in <module>
File "/Users/marco/Envs/test/lib/python2.7/distutils/__init__.py", line 16, in <module>
exec(open(os.path.join(distutils_path, '__init__.py')).read())
IOError: [Errno 2] No such file or directory: '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/__init__.py'
----------------------------------------
...Installing setuptools...done.
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 8, in <module>
load_entry_point('virtualenv==1.7.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 1052, in create_environment
search_dirs=search_dirs, never_download=never_download)
File "/Library/Python/2.7/site-packages/virtualenv.py", line 598, in install_setuptools
search_dirs=search_dirs, never_download=never_download)
File "/Library/Python/2.7/site-packages/virtualenv.py", line 570, in _install_req
cwd=cwd)
File "/Library/Python/2.7/site-packages/virtualenv.py", line 1020, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /Users/marco/Envs/test/bin/python -c "#!python
\"\"\"Bootstra...sys.argv[1:])
" /Library/Python/2.7/...ols-0.6c11-py2.7.egg failed with error code 1

Can you help me?

Thanks! Mark

解决方案

You don't have setuptools installed,

Install it from here

if you upgraded from lion to mountain lion, the python install is broken due to some changes in the file-system, ideally you should install command line tools from xcode, then python from python website, then setuptools from python website and then pip via easy_install, everything will work afterwards.

这篇关于当山狮ex mkvirtualenv出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆