1

bitbucket から hg (mercurial) を使用してリポジトリのクローンを作成しようとすると、次の python トレースを受け取りました。

'import site' failed; use -v for traceback
Traceback (most recent call last):
  File "/usr/bin/hg", line 25, in <module>
    mercurial.util.set_binary(fp)
  File "/auto/igb-libs/linux/centos/6.x/x86_64/pkgs/python/2.7.4/lib/python2.7/site-    packages/mercurial/demandimport.py", line 86, in __getattribute__
    self._load()
  File "/auto/igb-libs/linux/centos/6.x/x86_64/pkgs/python/2.7.4/lib/python2.7/site-    packages/mercurial/demandimport.py", line 58, in _load
    mod = _origimport(head, globals, locals)
  File "/auto/igb-libs/linux/centos/6.x/x86_64/pkgs/python/2.7.4/lib/python2.7/site-packages/mercurial/util.py", line 16, in <module>
    from i18n import _
  File "/auto/igb-libs/linux/centos/6.x/x86_64/pkgs/python/2.7.4/lib/python2.7/site-packages/mercurial/demandimport.py", line 114, in _demandimport
    mod = _origimport(name, globals, locals)
  File "/auto/igb-libs/linux/centos/6.x/x86_64/pkgs/python/2.7.4/lib/python2.7/site-packages/mercurial/i18n.py", line 17, in <module>
    base = os.path.dirname(module)
  File "/auto/igb-libs/linux/centos/6.x/x86_64/pkgs/python/2.7.4/lib/python2.7/site-packages/mercurial/demandimport.py", line 86, in __getattribute__
    self._load()
  File "/auto/igb-libs/linux/centos/6.x/x86_64/pkgs/python/2.7.4/lib/python2.7/site-packages/mercurial/demandimport.py", line 58, in _load
    mod = _origimport(head, globals, locals)
  File "/auto/igb-libs/linux/centos/6.x/x86_64/pkgs/python/2.7.4/lib/python2.7/os.py", line 466, in <module>
    class _Environ(UserDict.IterableUserDict):
  File "/auto/igb-libs/linux/centos/6.x/x86_64/pkgs/python/2.7.4/lib/python2.7/site-packages/mercurial/demandimport.py", line 86, in __getattribute__
    self._load()
  File "/auto/igb-libs/linux/centos/6.x/x86_64/pkgs/python/2.7.4/lib/python2.7/site-packages/mercurial/demandimport.py", line 58, in _load
    mod = _origimport(head, globals, locals)
  File "/auto/igb-libs/linux/centos/6.x/x86_64/pkgs/python/2.7.4/lib/python2.7/UserDict.py", line 84, in <module>
    _abcoll.MutableMapping.register(IterableUserDict)
  File "/auto/igb-libs/linux/centos/6.x/x86_64/pkgs/python/2.7.4/lib/python2.7/abc.py", line 109, in register
    if issubclass(subclass, cls):
  File "/auto/igb-libs/linux/centos/6.x/x86_64/pkgs/python/2.7.4/lib/python2.7/abc.py", line 184, in __subclasscheck__    
cls._abc_negative_cache.add(subclass)
  File "/auto/igb-libs/linux/centos/6.x/x86_64/pkgs/python/2.7.4/lib/python2.7/_weakrefset.py", line 84, in add
    self.data.add(ref(item, self._remove))
TypeError: cannot create weak reference to 'classobj' object

誰かがこの問題に遭遇しましたか?

4

1 に答える 1

2

これは、カスタム コンパイルされた Python 2.7.4 とシステム デフォルトの mercurial (CentOS 6.3) の間のバージョンの競合でした。この問題を解決するには、PYTHONPATH を空にする必要がありました

export PYTHONPATH=

bitbucket チェックアウトは最終的に機能しました。

destination directory: pycula
requesting all changes
adding changesets
adding manifests
adding file changes
added 79 changesets with 246 changes to 80 files
updating to branch default
于 2013-08-06T20:46:05.267 に答える