2

I'm using python's argparse package in CentOS6. I installed it by the following command.

# yum install python-argparse

However, I could not find the package in RHEL5 and 6. Where is it? How can I get argparse?

ITO Yosei
  • 949
  • 2
  • 8
  • 21

2 Answers2

6

Try to install python packages via easy_install or pip:

# easy_install argparse

# pip install argparse

you can install easy_install or pip via your package manager.

mortymacs
  • 3,456
  • 3
  • 27
  • 53
  • Thanks. I could install via pip! `easy_install pip && pip install argparse` – ITO Yosei Nov 06 '13 at 06:45
  • In RHEL5, I had to install "python-setuptools" package first. – ITO Yosei Nov 06 '13 at 06:58
  • 1
    // , You can also put argparse.py in the project directory. Download argparse.py from here, copy it to the project directory, and make sure to set the file as executable by the right owner: https://code.google.com/p/argparse/source/browse/argparse.py For more about this, check out the following answer about argparse: http://stackoverflow.com/a/21359591/2146138 – Nathan Basanese Sep 03 '15 at 22:30
  • @NathanBasanese thanks that was only solution as both pip and easy_install was missing from RHEL5 repo – Petr Sep 22 '16 at 07:36
0

argparse is a Python standard library,that mean you can just use

import argparse

to use it

Neo Ko
  • 1,365
  • 15
  • 25