"The 'ndg-httpsclient' distribution was not found" error

I had trouble using certbot for Apache on Debian 8. I figured out the solution, but thought I would post about it here for the benefit of other users, or in case the bug can be fixed.

This was the error:

$ certbot --apache
Traceback (most recent call last):
  File "/usr/bin/certbot", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3019, in <module>
    @_call_aside
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3003, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3032, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 655, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 963, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 849, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'ndg-httpsclient' distribution was not found and is required by requests

This was my solution:

sudo apt-get install python-pip
sudo pip install ndg-httpsclient
sudo certbot --apache
1 Like

Thanks! I recall this person recently having a similar problem; in their case, the solution was to sudo apt-get install python-ndg-httpsclient -t jessie-backports.

I think the problem is that the package has an undeclared dependency - python-requests recommends python-ndg-httpsclient but neither it nor any certbot package explicitly declares an actual dependency on it - which I guess it probably should, if Certbot doesn’t work at all without it.

1 Like

I reported this as a bug.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=861513

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.