Installing Mercurial Without Admin Rights And No C Compiler

Cheap webhosters can be pretty limiting sometimes in the platforms they run and the software packages on offer, even when you do have shell access. Here’s a quick guide to setting Mercurial up on a shared webhost for use when:

  • there is no Python.h available, so you cannot build the C extensions
  • you can build only the pure Python modules, which is slower but more compatible
  • you have to do all of this in your home directory somewhere

Prerequisites

To build Mercurial plus its documentation (e.g. build all), you need to have the Python doctools package.  To most easily install the doctools package, it helps to have the Python easy_install package.

easy_install

It’s best to choose one directory where all of your Python eggs and modules will live. In my case, I chose “~/software”, which means the software directory under my home directory.

The first time you run the setuptools install, it may complain about the installation directory not existing:

So create the directory:

Then run setuptools again:

The second time you should see something like:

Make the easy_install command available by exporting its directory to your PATH:

Now you can run easy_install from everywhere, but you have to always remember to provide the install prefix you chose for where your python modules should live.

docutils

Mercurial

Now that docutils is installed in your private Python packages, you can move on to installing Mercurial.

Then you just have to move the Mercurial directories into the site-packages directory.

Using Mercurial

Now you have a fully-functional Mercurial install that you can use, for instance, to locally revision control content in your webdirectories.

e.g. You have a simple website in public_html, you can do something like:

Now your changes will be tracked, how sweet is that?

One thought on “Installing Mercurial Without Admin Rights And No C Compiler”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.