Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to install Mercurial on AIX 6.5 without root? I'm a physics student and am developing code on the IBM cluster in our college and don't have root privilege. Several weeks ago I decided to use Mercurial to help control my code. I've contacted the system manager, but he said "Mercurial falls in the category of unsupported software" on the AIX system and he cannot help me. I've tried to find a guide on the web for a long time, but don't have any luck. I'm only familiar with the very basic commands on Linux, and not familiar with the complicated make file in the source code. Could you give a step by step guide of how to build Mercurial from the source?


The system has Python 2.6, but the Python installation seems incomplete. When I tried the answer by @grawity, I received error "Couldn't import standard bz2 (incomplete Python install)."


I tried to compile Python 2.6.8 without problem, but when I try

python install --user

I get the error

Traceback (most recent call last):
File "", line 56, in <module>
import os, subprocess, time
File "/home/mwu3/install_python/lib/python2.6/", line 416, in <module>
import fcntl
ImportError: No module named fcntl


I looked into the build log of Python, and actually it fails to build a lot packages, fcntl included:

Failed to find the necessary bits to build these modules:
_sqlite3           bsddb185           dl
imageop            linuxaudiodev      ossaudiodev
spwd               sunaudiodev
To find the necessary bits, look in in detect_modules() for the module's name.

Failed to build these modules:
_bsddb             _ctypes            _curses
_curses_panel      _tkinter           fcntl

I use this to compile Python:

CC=gcc CXX=g++ ./configure --enable-shared


I try to compile Python with xlc:

CC=xlc_r OPT="-O2 -qmaxmem=70000" ./configure --without-computed-gotos --enable-shared

Also get the same error in update3.


I try to compile Python 2.7.3 with xlc also get error but fcntl and _bsddb are built successfully.

Python build finished, but the necessary bits to build these modules were not found:
_bsddb             _sqlite3           bsddb185
dl                 imageop            linuxaudiodev
ossaudiodev        spwd               sunaudiodev
To find the necessary bits, look in in detect_modules() for the module's name.

Failed to build these modules:
_ctypes            _curses            _curses_panel
share|improve this question
Does the system have a recent version of Python (2.4–2.7)? – grawity Mar 17 '13 at 21:19
@grawity Yes it has Python 2.6.2. – xslittlegrass Mar 17 '13 at 21:29
up vote 0 down vote accepted

From the thread Running Mercurial on a Flash Drive? I get the impression that Mercurial is basically portable, as long as all the dependencies are installed. It seems as though the entire package resides in one directory (although I don't have the environment to test Mercurial).

I am not using AIX, but on Linux it is possible to simply extract the contents of an RPM using :

cd my-dir;
rpm2cpio to-install.rpm | cpio -idv

For more info see How To Extract an RPM Package Without Installing It (rpm extract command).

You would need to repeat this, or install from source, all the dependencies.

This would work if the installation of Mercurial is relatively simple and does not require access to directories only accessible by root.

share|improve this answer

Download the Mercurial source tarball, extract it, and run:

python install --user

It will be installed to ~/.local/lib/python2.6/, with the executable commands at ~/.local/bin/ – add the latter to your $PATH.

You will need at least Python 2.6 for the "user base" directory, and gcc to compile some OS-specific modules.

share|improve this answer
Thanks for the answer, but when I tried this, I get error: "Couldn't import standard bz2 (incomplete Python install)." I've contacted the root, but he would not fix for me. So I should reinstall python, is that right? Do you know how to do that? – xslittlegrass Mar 17 '13 at 21:50

Your Answer


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.