Python 2.6 ImportError: No module named argparse
Question: I'm trying to run git-cola from Red Hat Enterprise Linux Server release 6.5
and receive:

    
    
    Traceback (most recent call last):
    File "....../bin/git-cola", line 24, in <module>
    from argparse import ArgumentParser
    ImportError: No module named argparse
    

I think I have all of the required packages installed:

    
    
    * git-1.7.1-3.el6_4.1.x86_64
    * python-2.6.6-51.el6.x86_64
    * PyQt4.x86_64 0:4.6.2-9.el6
    * /usr/lib/python2.6/site-packages/argparse-1.2.1-py2.6.egg
    

I read in other blogs that there may be a problem with Python 2.6 and may need
to move to 2.7.

Additional information - @iljau noticed that argparse is in a 32 bit lib,
while the rest of python is in 64 bits. I would have expected that:

    
    
    easy_install argparse
    

would have sorted this out and installed the 64 bit version.

Additional question: Does anyone know how to install the 64 bit version of
argparse. It is not apparent to me from searching the internet. I will
continue looking.

I installed argparse by downloading the tar file and

    
    
    python setup.py install
    

However, it still installed it in the lib rather than lib64 path - and it
looks like a 64 bit install. So something else must be the problem in
referencing argparse properly. I don't know Python enough to debug it, but I
suspect that git-cola needs some work for Python 2.6.


Answer: As a simple solution copy `argparse.py` from
<https://code.google.com/p/argparse/source/browse/argparse.py> to your project
folder.

* * *

And indeed, for Python 2.6 `argparse` needs to be installed separately.

From: <https://pypi.python.org/pypi/argparse>

> As of Python >= 2.7 _.._ the argparse module is maintained within the Python
> standard library. For users who still need to support Python < 2.7 _.._ it
> is also provided as a separate package, which _.._ also supports older
> Python versions.

But even after you install `argparse`, it may refuse to work for some
mysterious reasons.

Additional debugging tips may be found in answers and comments to question
["ImportError: No module named
argparse"](http://stackoverflow.com/q/15093444/2419207).

