由于“ImportError:没有名为osutil的模块”,无法运行hg

时间:2015-01-05 12:12:45

标签: python macos mercurial importerror

尝试运行任何hg命令时,我收到以下错误。

我试图卸载&再次安装XCode和开发工具。

Traceback (most recent call last):
File "/usr/local/bin/hg", line 41, in <module>
mercurial.util.setbinary(fp)
File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 102, in __getattribute__
File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 74, in _load
File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 43, in _hgextimport
File "/usr/local/lib/python2.7/site-packages/mercurial/util.py", line 66, in <module>
File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 102, in __  getattribute__
File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 74, in _load
File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 43, in _hgextimport
ImportError: No module named osutil

osutil.so存在于/usr/local/lib/python2.7/site-packages/mercurial。

1 个答案:

答案 0 :(得分:10)

osutil是mercurial的一部分。 转到您下载mercurial的文件夹并运行

make local

确保它正确运行,你应该好好去。