Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using Ubuntu 10.04 and I just installed Mercurial 1.5.4 from source (see this question for some installation trouble that I had). Now, however, when I invoke:

hg

I get the following:

  File "/usr/local/bin/hg", line 27, in <module>
    mercurial.dispatch.run()
  ...
  File "/usr/lib/pymodules/python2.6/mercurial/demandimport.py", line 47, in _load
    mod = _origimport(head, globals, locals)
ImportError: No module named osutil

yet

find /usr/local/lib -name osutil* -print

returns

/usr/local/lib/python2.6/dist-packages/mercurial/osutil.so

which I assume can be loaded by Python scripts similar to Perl and XS. With the exception of adding python-dev (see answer at above link) my Python installation is exactly as it came with Ubuntu 10.04 after upgrading to 10.04 from 9.10.

What's going on?

share|improve this question
    
from your earlier question, it seems the C modules are still not properly compiled. They should be with your manual install in /usr/lib/pymodules/python2.6/mercurial/. –  tonfa Jun 26 '10 at 11:48
    
Ok, so what do I do about it? –  gvkv Jun 26 '10 at 13:13
add comment

4 Answers

Just for the sake of helping others, I just solved the missing osutil.py in Ubuntu 13.04, without which mercurial won't run.

I had to install python-sphinx (and related). This looks like a dependency check failure in the mercurial package.

share|improve this answer
add comment

if you are running under windows you will find a folder "pure" inside of "\site-packages\mercurial\". Inside of it, there are a bunch of .py (osutil.py is one of them)

Just copy all files inside "pure" to the "mercurial" folder and DONE! It just starts working.

Hope this helps!

share|improve this answer
add comment

This usually means you need to uninstall the mercurial-common package from Ubuntu - it can be earlier in the Python search path and cause weird problems like this.

share|improve this answer
    
This did it for me. I had a manual compiled Mercurial and remove the Ubuntu version first but had that package still around. –  Martin Scharrer Sep 30 '11 at 12:49
add comment

Per http://mercurial.808500.n3.nabble.com/Mercurial-1-5-2-released-td806821.html, you need the python-dev package. For example, on Debian or Ubuntu, you would install it with

sudo apt-get install python-dev

If that doesn't work right away, then re-do the Mercurial source installation, and that may solve the problem (it did for me).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.