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 foun开发者_运维百科d 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.
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.
Sorry this is super late. I ended up installing python 2.7, and running hg from the command line
After installing python and adding it to your path, run the following commands from the windows commands prompt:
python -m pip install -U pip setuptools
python -m pip install matplotlib
python -m pip install mercurial
After that clone hgactivity
hg clone http://sources.freehackers.org/Hgactivity/
Then add it to your mercurial.ini file:
[extensions]
activity = C:\Repos\Hgactivity\activity
And now from the command line you should be able to do this:
C:\Python27\Scripts\hg activity --help
Hope that helps.
精彩评论