I have a VPS with Centos 5.5, installed Python 2.6 following Setup Python 2.5, mod_wsgi, and Django 1.0 on CentOS 5 (cPanel) tutorial and Mercurial 1.6 via easy-install.

Now I wanted to update to Mercurial 1.7.5, so I easy-installed it and it seemed to work. At least when used from terminal.

I have been using hgwebdir to push/pull my reposisotires via HTTP. However, when I try to view a repository created with new hg (1.7.5), I get the 500 error page. A look in Apache error_log reads something about dotencode support

 RepoError: requirement 'dotencode' not supported,

Google says it's a problem when old hg tries to read a repository made with a new hg.

How can I find out which hg is used by Apache/mod_wsgi? And how to update it?


Just to clarify, it sounds like you WERE using mod_wsgi compiled against Python 2.5 (which has an old version of hg). You are now trying to run mod_wsgi with Python 2.6 (which has hg 1.7.5).

Assuming you followed the instructions in the article you linked, you'll notice that you compiled mod_wsgi against the sources in Python 2.5. mod_wsgi doesn't launch a Python interpreter; instead, it calls into the Python sources directly. So if you want mod_wsgi to work with Python 2.6, you'll have to recompile it with the Python 2.6 sources.

You can follow the same steps as the article, only using Python 2.6's sources instead of Python 2.5. I've compiled mod_wsgi against Python 2.6 before, and the article looks like its spot on.

Hope this helps, and definitely leave comments if you encounter any issues.


To me, it sounds like one of two things:

  • you need to restart the webserver after installing the new version of Mercurial. When you use mod_wsgi, Apache will keep a copy of the script running in memory so that it can quickly serve new requests. So there might be a Mercurial 1.6 running in memory still. Restarting Apache should help.

  • you've installed multiple versions of Mercurial on the machine. Try searching for commands.py and see if you find more than one version. Then remove the old version and re-install it as Redmumba suggests.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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