在 OSX 上从 64 位 Python 切换到 32 位 Python 后 Virtualenv 将无法工作
我使用 python.org 上的官方 DMG 安装程序重新安装了 Python 2.7,因为我需要使用预编译的二进制文件,该二进制文件在我的 64 位 Python 安装中出现问题。
(重新编译它以在 64 位中运行对我来说太困难了,不是一个选项)
它有效,Python mac 安装程序修复了所有链接,因此我的新 python 安装是 32 位,但我使用64 位 Python 无法再使用 Python,这是输出:
dyld: Library not loaded: @executable_path/../.Python
Referenced from: /Users/dom/django/.virtualenvs/lepoc/bin/python
Reason: no suitable image found. Did find:
/Users/dom/django/.virtualenvs/lepoc/bin/../.Python: no matching architecture in universal wrapper
/Users/dom/django/.virtualenvs/lepoc/bin/../.Python: no matching architecture in universal wrapper
Trace/BPT trap
是否有可能的修复(例如重新链接某些内容)或者我必须重新创建所有 virtualenv ?
I re-installed Python 2.7 with the official DMG installer from python.org because I needed to use a pre-compiled binary which choked on my 64-bit Python install..
(Recompiling it to run in 64-bit is too difficult for me, not an option)
It worked, the Python mac Installer fixes all the links, so my new python install is 32-bit, but all the virtualenv I had created with the 64-bit Python cannot use Python anymore, here is the output :
dyld: Library not loaded: @executable_path/../.Python
Referenced from: /Users/dom/django/.virtualenvs/lepoc/bin/python
Reason: no suitable image found. Did find:
/Users/dom/django/.virtualenvs/lepoc/bin/../.Python: no matching architecture in universal wrapper
/Users/dom/django/.virtualenvs/lepoc/bin/../.Python: no matching architecture in universal wrapper
Trace/BPT trap
Is there a possible fix (like re-linking something) or do I have to re-create all my virtualenv ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会重新创建它们。 bin 文件夹中的“python”可执行文件是一个可执行文件,可能特定于您的体系结构和/或 python 二进制文件。您可以保存所有已安装的 python 软件包并使用 pip 在新的虚拟环境中重新安装它们:
另请参阅 http://www.saltycrane.com/blog/2009/05/notes-using-pip-and-virtualenv-django/
I'd go with recreating them. The "python" executable in the bin folder is an executable and is probably specific to your architecture and/or python binary. You can save all installed python packages and reinstall them in the new virtual environment using pip:
See also http://www.saltycrane.com/blog/2009/05/notes-using-pip-and-virtualenv-django/