悦读 FM

倾听文字的声音(pyramid+sqlbean) ...

↑我也要推荐

go-pylons.py 在 Python2.7 下错误解决

发布时间:2011-08-06 19:07:33, 关注:+6322, 赞美:+7, 不爽:+9

本文标签: go-pylons

原始出处: Log4D

当使用 Python2.7 + go-pylons.py 创建 Pylons 运行环境的话,会报一下错误。

[alswl@arch-vm xingtong]$ python go-pylons.py myb_env
New python executable in myb_env/bin/python
Traceback (most recent call last):
  File "/home/alswl/work/xingtong/myb_env/lib/python2.7/site.py", line 67, in <module>
    import os
  File "/home/alswl/work/xingtong/myb_env/lib/python2.7/os.py", line 398, in <module>
    import UserDict
  File "/home/alswl/work/xingtong/myb_env/lib/python2.7/UserDict.py", line 83, in <module>
    import _abcoll
  File "/home/alswl/work/xingtong/myb_env/lib/python2.7/_abcoll.py", line 11, in <module>
    from abc import ABCMeta, abstractmethod
  File "/home/alswl/work/xingtong/myb_env/lib/python2.7/abc.py", line 8, in <module>
    from _weakrefset import WeakSet
ImportError: No module named _weakrefset
ERROR: The executable myb_env/bin/python is not functioning
ERROR: It thinks sys.prefix is '/home/alswl/work/xingtong' (should be '/home/alswl/work/xingtong/myb_env')
ERROR: virtualenv is not compatible with this system or executable

STFW 之后,找到了引发错误的根源 virtualenv ,这个 bug 在这里已经修复了。

#!diff
--- a/virtualenv.py        2010-09-14 21:48:58.078562930 +0200
+++ b/virtualenv.py        2010-09-14 21:46:20.650769346 +0200
@@ -51,6 +51,8 @@ REQUIRED_FILES = ['lib-dynload', 'config

if sys.version_info[:2] >= (2, 6):
     REQUIRED_MODULES.extend(['warnings', 'linecache', '_abcoll', 'abc'])
+    if sys.version_info[:2] >= (2, 7):
+        REQUIRED_MODULES.extend(['_weakrefset'])
if sys.version_info[:2] <= (2, 3):
     REQUIRED_MODULES.extend(['sets', '__future__'])
if is_pypy:

 懒人可以点击 go-pylons.py 下载。

如果你觉得本站对你有帮助,欢迎向本站赞助 :P

使用支付宝捐赠

Copyright© Python4cn(news, jobs) simple-is-better.com, 技术驱动:powered by web.py 空间主机:Webfaction

版权申明:文章转载已注明出处,如有疑问请来信咨询。本站为 python 语言推广公益网站,与 python 官方没有任何关系。

联系/投搞/留言: en.simple.is.better@gmail.com 向本站捐赠