当前位置:  开发笔记 > 编程语言 > 正文

在Mac OS X上运行Virtualenv时出现问题

如何解决《在MacOSX上运行Virtualenv时出现问题》经验,为你挑选了2个好方法。

我在Mac OS X 10.6.2(已安装Xcode)和Python 2.6上使用virtualenv-1.4.5.这是我试图运行virtualenv时得到的...

 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 
    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

有什么建议为什么会抛出这个错误?



1> 小智..:

您真正需要做的就是安装Xcode"命令行工具",有两种方法可以做到:

1.-如果您已经安装了Xcode,请转到首选项 - >下载并选择"命令行工具".

2.-从以下网址下载"Xcode命令行工具".dmg:https://developer.apple.com/downloads.

您可以使用App Store安装Xcode,但默认情况下不会包含"命令行工具".


是的,很棒的电话.从Snow Leopard升级到Lion之后我遇到了这个问题.

2> 小智..:

从App Store安装XCode以解决问题.我有同样的错误,安装XCode,安装后运行它,现在virtualenv工作.

推荐阅读
我我檬檬我我186
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有