如何将 Python 2.65 UCS-2 版本替换为使用 UCS-4 构建的版本,而不丢失站点包中的所有内容?
我下载了 Python 2.6.5 源代码,为 OS 10.6.4 64 位构建它,并安装了许多依赖项。我打开了我们团队最近正在进行的一个大项目,运行了单元测试,其中一个测试失败了,因为我安装了使用 UCS-2 构建的 Python(我不知道这是 OS X 的默认设置!)
<简而言之: 我在构建 Python 时没有提供标志 --enable-unicode=ucs4
。 (我发现这是必要的: http://copia.posterous .com/confusion-over-python-storage-form-for-unicod)
现在我想纠正这个问题,而不会丢失我放入站点包中的所有内容。
这可能吗?如果是这样,怎么办?
谢谢你! 米肖
I downloaded the Python 2.6.5 source, built it for OS 10.6.4 64-bit, and installed numerous dependencies. I opened a big project our team has been working on recently, ran the unit tests, and one of the tests failed because I had installed Python built using UCS-2 (I didn't know this was the default of OS X!)
In a nutshell:
I didn't supply flag --enable-unicode=ucs4
when building Python.
(as I discovered was necessary: http://copia.posterous.com/confusion-over-python-storage-form-for-unicod)
Now I want to correct this without losing everything I put in site-packages.
Is this possible? If so, how?
Thank you!
Michaux
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以保存和恢复
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages
(例如作为.tar.bz2
) ,但是如果恢复的.so
的任何入口点处理 Python Unicode 对象,那么这些包(包含任何此类.so)将无法正常工作。 so
文件)一旦你的新 Python 版本开始工作,你就必须重建/重新安装!希望这与您放入站点包中的“所有内容”相去甚远(祈祷)。You can save and restore
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages
(e.g. as a.tar.bz2
), but the restored.so
s will not work properly if any of their entry points deal with Python Unicode objects -- so, those packages (containing any such.so
files) you'll have to rebuild/reinstall once your new Python version is working! Hopefully that's a far cry from "everything" you've put in site-packages (fingers crossed).