2

Since argparse is in Python 2.7 but my 2.6 installs need it I have argparse in my requirements.txt. Is there a way to not install it when it is built into the installed Python already?

I tried adding just 'argparse' with no version specified to my requirements.txt but pip still downloaded and installed argparse on my Mac running Python 2.7.1.

Sean Perry
  • 3,776
  • 1
  • 19
  • 31
  • Closely related: [Optional dependencies in a pip requirements file](http://stackoverflow.com/q/3664478) – Martijn Pieters Jun 20 '14 at 19:10
  • Is that necessary? If I try to install `argparse` on Fedora 21 I got the following error: `pip install argparse Requirement already satisfied (use --upgrade to upgrade): argparse in /usr/lib/python2.7/site-packages`. I think you could simply add `argparse` as requirement without checking for a specific Python version. – Christian Berendt Jun 20 '14 at 19:15
  • I did exactly that @ChristianBerendt and it installed argparse. That is why I asked the question. – Sean Perry Jun 20 '14 at 19:41
  • Thanks for the link @MartijnPieters. But argparse is not optional, my code will break. I just do not want to install the one from pypi if my Python already has it built in. – Sean Perry Jun 20 '14 at 19:42

0 Answers0