gmr / consulate

Python client for the Consul HTTP API
http://consulate.readthedocs.org
BSD 3-Clause "New" or "Revised" License
342 stars 101 forks source link

pkg_resources.DistributionNotFound: argparse on latest rc 7 #99

Closed shakisha closed 7 years ago

shakisha commented 7 years ago

i'm trying to backup and restore the consul kv consul-alerts configuration by running the command:

consulate kv backup consul-alerts/config -f consul-alerts-config.json

but it will throw me this error

consulate: error: unrecognized arguments: consul-alerts/config

Maybe a new different version of consulate not allowing me to specify the kv to backup?

shakisha commented 7 years ago

ok, i have seen that this issue is because i was using stable version of consulate (6) instead of release candidate (7).

But now, on my centos 6.7, i install consulate with this command

pip install --upgrade git+https://github.com/gmr/consulate.git

and now i have got this error when running consulate:

Traceback (most recent call last):
  File "/usr/bin/consulate", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2655, in <module>
    working_set.require(__requires__)
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 648, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 546, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: argparse

latest stable version was not giving me this error.

shakisha commented 7 years ago

Now i have run

yum -y reinstall python-argparse python-pip 

and the error changed to

Traceback (most recent call last):
  File "/usr/bin/consulate", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2655, in <module>
    working_set.require(__requires__)
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 648, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 546, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: requests>=2.0.0,<3.0.0
shakisha commented 7 years ago

Of course,

pip list | grep "requests"

gives me

requests (2.12.4)
shakisha commented 7 years ago

trouble fixed running these commands:

pip install --upgrade git+https://github.com/gmr/consulate.git
easy_install --upgrade requests
yum -y reinstall python-argparse