Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue with installing Mercurial Activity extension

I'm using Windows XP with installed Mercurial TortoiseHg on it. Now I need to install the external activity extension. I downloaded the extension and enabled it in hgrc.

When I'm try to call it using command:

hg activity

I receive the following error:

There are 292 changesets
Hg activity options: you need matplotlib in your python path in order to use the hg activity extension.

Then I installed the python 2.6 and matplotlib. So the paths of them are:

  • D:\Python26\
  • D:\Python26\Lib\site-packages\matplotlib

Now I don't know how to tell mercurial activity extension to use matplotlib from that location? I found some explanation in the TortoiseHg FAQ, under the heading "Where do TortoiseHg extensions look for external Python modules on Windows?"

But when I do the steps that are written there I receive the same error message as above.

like image 842
Danilo Puric Avatar asked Nov 14 '22 06:11

Danilo Puric


1 Answers

I tried the approach and seems to work fine.

You will need to include the path as

import sys
sys.path.append(r'C:\Python26\Lib\site-packages')

Also see the following code @ http://bitbucket.org/tortoisehg/stable/src/cf4b3dfd15ee/contrib/hg

# enable importing on demand to reduce startup time
try:
    from mercurial import demandimport; demandimport.enable()
except ImportError:
    sys.stderr.write("abort: couldn't find mercurial libraries in [%s]\n" %
                     ' '.join(sys.path))
    sys.stderr.write("(check your install and PYTHONPATH)\n")
    sys.exit(-1)

You should be able to add the following path (D:\Python26\Lib\site-packages) in PYTHONPATH environment variable too.

This should allow python bundled with TortoiseHg to look at non-standard paths outside the bundled directory.

like image 70
pyfunc Avatar answered Dec 14 '22 22:12

pyfunc