certbot error: The 'argparse' distribution was not found and is required by certbot
In a recent Alpine edge installation, certbot throws the error: pkg_resources.DistributionNotFound: The ‘argparse’ distribution was not found and is required by certbot
To reproduce, using LXD on Ubuntu 16.04:
$ lxc launch images:alpine/edge/amd64 edge
$ lxc exec edge ash
- apk add certbot
- certbot
Traceback (most recent call last):
File “/usr/bin/certbot”, line 6, in
from pkg_resources import load_entry_point
File “/usr/lib/python2.7/site-packages/pkg_resources/init.py”, line 3019, in
@_call_aside
File “/usr/lib/python2.7/site-packages/pkg_resources/init.py”, line 3003, in _call_aside
f(args,*kwargs)
File “/usr/lib/python2.7/site-packages/pkg_resources/init.py”, line 3032, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File “/usr/lib/python2.7/site-packages/pkg_resources/init.py”, line 655, in _build_master
ws.require(requires)
File “/usr/lib/python2.7/site-packages/pkg_resources/init.py”, line 963, in require
needed = self.resolve(parse_requirements(requirements))
File “/usr/lib/python2.7/site-packages/pkg_resources/init.py”, line 849, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The ‘argparse’ distribution was not found and is required by certbot
A similar error has been reported in other distributions (archlinux).
See also:
https://community.letsencrypt.org/t/python-errors-on-install/31532/4
Affected version is “edge”, but there is no “edge” in the affected
versions list.
/etc/alpine-release contains “3.5.0”
certbot on edge is significantly newer than certbot on Alpine 3.5, with more features. That’s why I used edge for this, and I would like to continue using it.
(from redmine: issue id 7179, created on 2017-04-20, closed on 2019-05-03)
- Changesets:
- Revision efb9642f on 2017-04-20T15:27:47Z:
community/py-argparse: new aport. Fixes #7179
Directly on community since it's a new dependency for certbot package