Python 2.6 ImportError: no module named argparse

I am trying to run git-cola from Red Hat Enterprise Linux Server version 6.5 and getting:

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 the necessary 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 on other blogs that there might be a problem with Python 2.6 and may need to upgrade to 2.7.

Additional information - @iljau noticed that argparse is in a 32-bit lib and the rest of python is in 64-bit. I would expect that:

easy_install argparse

will sort this and install the 64-bit version.

Additional question: Does anyone know how to install the 64-bit version of argparse. I don’t think I’m looking on the Internet. I will continue to search.

I installed argparse by downloading the tar file and

python setup.py install

lib, lib64, 64- . argparse. Python , , git -cola Python 2.6.

+4
4

argparse.py https://code.google.com/p/argparse/source/browse/argparse.py .


, Python 2.6 argparse .

: https://pypi.python.org/pypi/argparse

Python >= 2.7.. argparse Python. , - Python < 2.7.. , Python.

argparse - .

​​ ImportError: No module named argparse.

+5

RHEL6, python-argparse.noarch:

yum install python-argparse.noarch

.

+5

:

/usr/lib/python2.6/site-packages

Installing them using sudo left the newly installed directories and files unreadable by everyone. Recursive chmod to open all installed paths as readable by all:

chmod -R u+rwX,go+rX,go-w <new directories and files>
+1
source

It seems that argparse is missing.

yum install python-argparse
0
source

Source: https://habr.com/ru/post/1523755/


All Articles