在 Mac OS X 10.6.7、Python 2.7.1 上运行 Virtualenv 1.6 时

发布于 2024-11-01 18:02:47 字数 2284 浏览 0 评论 0原文

我目前正在尝试在 Python 2.7.1 和 Django 1.3 之上设置 pinax。

对于前几个步骤,需要使用以下命令设置 virtualenv:

$ virtualenv mysite-env
$ 源 mysite-env/bin/activate
(mysite-env)$

我执行第一个命令,它创建了一个 mysite-env 目录,但出现以下错误:

mysite-env/bin/python 中的新 python 可执行文件
执行命令 install_name_tool -change /Library/Frameworks/.../Versions/2.7/Python @executable_path/../.Python mysite-env/bin/python
时出现错误 [Errno 2] 没有此类文件或目录 无法调用 install_name_tool ——您必须安装 Apple 的开发工具 回溯(最近一次调用最后一次):
文件“/Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenv”,第 8 行,位于
load_entry_point('virtualenv==1.6', 'console_scripts', 'virtualenv')()
文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv.py”,第 745 行,位于 main
提示=选项.提示)
文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv.py”,第 836 行,在 create_environment
site_packages=site_packages,clear=clear))
文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv.py”,第 1098 行,位于 install_python
py_可执行文件])
文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv.py”,第 778 行,在 call_subprocess
cwd=cwd, env=env)
文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py”,第 672 行,在 __ init __ 中 错误读取、错误写入)
文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py”,第 1202 行,位于 _execute_child
引发 child_exception
OSError:[Errno 2]没有这样的文件或目录

执行第二个命令不起作用(考虑到第一个命令失败,这是有道理的):

bash:mysite-env/bin/activate:没有这样的文件或目录

我读过其他有类似问题的文件或目录。

在另一个线程中,有人提到 10.6 上的 Virtualenv 存在错误

在 Google 群组中,另一个人提供了Virtualenv 1.3.3 的补丁。

此时我最好的选择是什么?我应该安装 Virtualenv 1.3.3 并尝试该补丁(我知道它不适用于 1.6),还是应该尝试使其适用于我当前的版本?我可以使用 Virtualenv 的替代方案吗(请记住,我受到 pinax 设置的限制)。

感谢您的帮助。

I'm currently trying to set up pinax on top of Python 2.7.1 and Django 1.3.

For the first few steps, one is required to set up virtualenv, with the following commands:

$ virtualenv mysite-env
$ source mysite-env/bin/activate
(mysite-env)$

I execute the first command, and it creates a mysite-env directory, but gives the following error:

New python executable in mysite-env/bin/python
Error [Errno 2] No such file or directory while executing command install_name_tool -change /Library/Frameworks/.../Versions/2.7/Python @executable_path/../.Python mysite-env/bin/python
Could not call install_name_tool -- you must have Apple's development tools installed
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenv", line 8, in
load_entry_point('virtualenv==1.6', 'console_scripts', 'virtualenv')()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv.py", line 745, in main
prompt=options.prompt)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv.py", line 836, in create_environment
site_packages=site_packages, clear=clear))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv.py", line 1098, in install_python
py_executable])
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv.py", line 778, in call_subprocess
cwd=cwd, env=env)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __ init __
errread, errwrite)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

Executing the second command does not work (this makes sense considering the first failed):

bash: mysite-env/bin/activate: No such file or directory

I've read up on others that have had similar problems.

On another thread, someone mentioned there's a bug with Virtualenv on 10.6.

On google groups, another person offered a patch for Virtualenv 1.3.3.

What is my best bet at this point? Should I install Virtualenv 1.3.3 and try the patch (I know it doesn't work for 1.6), or should I try to make it work with my current version? Is there an alternative to Virtualenv I could use (keep in mind I am contrained by the setup of pinax).

Appreciate the help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

無心 2024-11-08 18:02:47

执行命令 install_name_tool 时没有此类文件或目录

install_name_tool 命令是 Mac OS X 开发人员工具的一部分。安装 Xcode 即可获取它。

No such file or directory while executing command install_name_tool

install_name_tool command is a part of Mac OS X Developer Tools. Install Xcode to get it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文