Centos7 Lets Encrypt(certbot) エラーのアップデート対応

centos7

今まで動いていたcertbotがエラーで落ちるようになったので、アップデートのメモ。作業したのは2019/12の話。以下、エラー内容。

# certbot renew
Traceback (most recent call last):
   File "/bin/certbot", line 9, in 
     load_entry_point('certbot==0.38.0', 'console_scripts', 'certbot')()
   File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 570, in load_entry_point
     return get_distribution(dist).load_entry_point(group, name)
   File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 2687, in load_entry_point
     return ep.load()
   File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 2341, in load
     return self.resolve()
   File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 2347, in resolve
     module = import(self.module_name, fromlist=['name'], level=0)
   File "/usr/lib/python2.7/site-packages/certbot/main.py", line 17, in 
     from certbot import account
   File "/usr/lib/python2.7/site-packages/certbot/account.py", line 17, in 
     from acme import messages
   File "/usr/lib/python2.7/site-packages/acme/messages.py", line 11, in 
     from acme import challenges
   File "/usr/lib/python2.7/site-packages/acme/challenges.py", line 12, in 
     import requests
   File "/usr/lib/python2.7/site-packages/requests/init.py", line 58, in 
     from . import utils
   File "/usr/lib/python2.7/site-packages/requests/utils.py", line 32, in 
     from .exceptions import InvalidURL
   File "/usr/lib/python2.7/site-packages/requests/exceptions.py", line 10, in 
     from .packages.urllib3.exceptions import HTTPError as BaseHTTPError
   File "/usr/lib/python2.7/site-packages/requests/packages/init.py", line 95, in load_module
     raise ImportError("No module named '%s'" % (name,))
 ImportError: No module named 'requests.packages.urllib3'

py…!pythonあんま分からんなーと思いつつ、いろいろ調べて試行錯誤した結果、以下のパッケージを更新すれば動くようになった。pythonのrequestsとsixとurllib3を更新すればいいみたい。

# pip uninstall requests
# yum reinstall python-requests

# pip uninstall six
# yum reinstall python-six

# pip uninstall urllib3
# yum reinstall python-urllib3

これでまた快適証明書更新ライフが送れるようになりました。

コメント

タイトルとURLをコピーしました