How to fix the error when using gitstats with git in windows

I’m learning how to use gitstats to create reports with git. So I downloaded and installed Git-1.8.1.2-preview20130201.exe , python-2.6.2.msi , gp463-win32-setup.exe(gnuplot) and cloned gitstats

from http://gitstats.com/. And I also add my git, python, gnuplot, gitstats to my PATH. Then I created a repository with “Git Bash” by myself named repo1. But when I input the command to create the

  • How to remove a branch locally?
  • Which $VARIABLES can be passed to an external tool from git-gui?
  • How to make submodule with detached HEAD to be attached to actual HEAD?
  • git-svn: how do I create a new svn branch via git?
  • Can I edit two files then make one commit using GitHub Web-based editor?
  • How to Access SSH SERVER via GIT Bash
  • reporting about repo1, it output an error like this:

    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
    C:\Users\Dynamsoft220\Desktop>e:
    E:\>cd Jeremy\Git\gitstats
    E:\Jeremy\Git\gitstats>python gitstats e:\Jeremy\Git\repo1 e:\Jeremy\Git\report
    [0.08100] >> gnuplot --version
    Output path: e:\Jeremy\Git\report
    Git path: e:\Jeremy\Git\repo1
    Collecting data...
    [0.12600] >> git shortlog -s HEAD | wc -l
    [0.08300] >> git show-ref --tags
    [0.18100] >> git rev-list --pretty=format:"%at %ai %aN <%aE>" HEAD | grep -v ^co
    mmit
    [0.09300] >> git rev-list --pretty=format:"%at %T" HEAD | grep -v ^commit
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "D:\Python26\lib\multiprocessing\forking.py", line 341, in main
        prepare(preparation_data)
      File "D:\Python26\lib\multiprocessing\forking.py", line 450, in prepare
        file, path_name, etc = imp.find_module(main_name, dirs)
    ImportError: No module named gitstats
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "D:\Python26\lib\multiprocessing\forking.py", line 341, in main
        prepare(preparation_data)
      File "D:\Python26\lib\multiprocessing\forking.py", line 450, in prepare
        file, path_name, etc = imp.find_module(main_name, dirs)
    ImportError: No module named gitstats
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "D:\Python26\lib\multiprocessing\forking.py", line 341, in main
        prepare(preparation_data)
      File "D:\Python26\lib\multiprocessing\forking.py", line 450, in prepare
        file, path_name, etc = imp.find_module(main_name, dirs)
    ImportError: No module named gitstats
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "D:\Python26\lib\multiprocessing\forking.py", line 341, in main
        prepare(preparation_data)
      File "D:\Python26\lib\multiprocessing\forking.py", line 450, in prepare
        file, path_name, etc = imp.find_module(main_name, dirs)
    ImportError: No module named gitstats
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "D:\Python26\lib\multiprocessing\forking.py", line 341, in main
        prepare(preparation_data)
      File "D:\Python26\lib\multiprocessing\forking.py", line 450, in prepare
        file, path_name, etc = imp.find_module(main_name, dirs)
    ImportError: No module named gitstats
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "D:\Python26\lib\multiprocessing\forking.py", line 341, in main
        prepare(preparation_data)
      File "D:\Python26\lib\multiprocessing\forking.py", line 450, in prepare
        file, path_name, etc = imp.find_module(main_name, dirs)
    ImportError: No module named gitstats
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "D:\Python26\lib\multiprocessing\forking.py", line 341, in main
        prepare(preparation_data)
      File "D:\Python26\lib\multiprocessing\forking.py", line 450, in prepare
        file, path_name, etc = imp.find_module(main_name, dirs)
    ImportError: No module named gitstats
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "D:\Python26\lib\multiprocessing\forking.py", line 341, in main
        prepare(preparation_data)
      File "D:\Python26\lib\multiprocessing\forking.py", line 450, in prepare
        file, path_name, etc = imp.find_module(main_name, dirs)
    ImportError: No module named gitstats
    

    I really have no idea about how to fix this error. Actually I thought maybe it is because the software version is too late, but it seems not! It seems too simple to be discussed for most of people

    TT, so I can’t find a lot of article about it. Any suggestions will be appreciate! Thanks~

  • Cannot apply stash to working directory
  • Converting Mercurial folder to a Git repository
  • Git Workflow: Clarification and Avoiding Antipatterns
  • git-apply fails mysteriously, how do I troubleshoot/fix?
  • pip unexpectedly not installing latest version of git package with branch/commit pinning
  • git diff algorithm that does not rip functions apart? (language-aware diff)
  • 2 Solutions collect form web for “How to fix the error when using gitstats with git in windows”

    I was having problems getting gitstats to run on Windows. First, I made sure I added paths to python:

    C:\> set PYTHON_PATH=C:\Python27;C:\Python27\Lib;C:\Python27\DLLs;C:\Python27\Lib\lib-tk
    C:\> set PATH=%PATH%;%PYTHON_PATH%
    

    Next, I added the path to gitstats, because, well, why not at this point:

    C:\> set PATH=%PATH%;c:\projects\gitstats
    

    Finally, I renamed gitstats to gitstats.py, it was mentioned in the issue log on github, and solved by @danio there:
    https://github.com/hoxu/gitstats/issues/34

    You must add the gitstat folder in the PYTHON_PATH.

    See this answer for how to add the PYTHON_PATH in windows.
    https://stackoverflow.com/a/3701730/1226582

    Git Baby is a git and github fan, let's start git clone.