how to fix "AttributeError: 'module' object has no attribute 'set_binary' "?
Question: i compiled mercurial successfully as follows: ...

    
    
    copying build/scripts-2.7/hg -> /usr/local/bin
    changing mode of /usr/local/bin/hg to 755
    running install_egg_info
    Writing /usr/local/lib/python2.7/site-packages/mercurial-2.8.1-py2.7.egg-info
    as3:~/mercurial-2.8.1# cd ~
    as3:~# hg clone http://hg.cat-v.org/werc/
    Traceback (most recent call last):
    File "/usr/bin/hg", line 25, in <module>
    mercurial.util.set_binary(fp)
            File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 103, in __getattribute__
    return getattr(self._module, attr)
    AttributeError: 'module' object has no attribute 'set_binary'
    as3:~#
    

how to fix it?tks. my python version:2.7.6


Answer: Note that you have installed mercurial from sources into `/usr/local/bin`, but
the error message mentions `/usr/bin/hg`. It means you have a different
version of mercurial main script installed under `/usr/bin/hg`, which then
tries to use new mercurial library from `/usr/local`. The error occurs,
because the 2 are incompatible.

To fix this, remove older mercurial from `/usr/bin`. You may need to call
`rehash` in your shell as well, for it to pick it up, depending on the shell.

If mercurial does not work then, it means `/usr/local/bin` is not in your
PATH. If that is the case you'll need to fix the PATH, or just symlink new hg,
like so:

    
    
    # ln -s /usr/local/bin/hg /usr/bin
    

But that will require root access, for example, calling it through sudo.

