-1
root@vps434142:~# certbot 
Traceback (most recent call last):
  File "/usr/bin/certbot", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3017, in <module>
    @_call_aside
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3003, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3030, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 659, in _build_master
    ws.require(__requires__)
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 967, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 853, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'certbot==0.28.0' distribution was not found and is required by the application
fuero
  • 9,413
  • 1
  • 35
  • 40
user1635700
  • 206
  • 2
  • 4
  • Did you install it from source? The reference to /usr/local/lib/python3.6 is strange. Which debian version are you running? – basekat Feb 27 '21 at 11:14
  • I had python3.5 and added 3.6 as well. but after that causes issues – user1635700 Feb 27 '21 at 11:33
  • It doesn't matter; that version of certbot is obsolete and will break anyway if you tried to use it. Debian and Ubuntu do not update certbot in the distribution as they should, which makes its presence there pointless. On Debian you should install certbot from snap and keep the snap updated automatically. – Michael Hampton Feb 27 '21 at 14:34

2 Answers2

1

Please note that the information you have given is very scarce and I am guessing here. Nevertheless I will try to help you.

Based on your answer(python 3.5) I am guessing that you are on debian stretch and not buster.

I would try to reinstall python3 and certbot and see if that helps:

apt-get update
apt-get upgrade
apt-get install --reinstall python3
apt-get install --reinstall certbot

If that doesn't help, you could try to install certbot via pip:

apt-get remove certbot
apt-get install python3-pip
pip3 install certbot
basekat
  • 416
  • 2
  • 5
0

I have on server python from "box" - 2.7 + 3.5, then I installed Python 3.7 for some project and than had error like you. Than i edited /usr/bin/certbot and change first line to #!/usr/bin/python3.5

This is helped me.

Idea - apt installs Certbot and python3-certbot install packages for 3.5, but actual version python3 is python3.7 not 3.5

SergeK
  • 1