ImportError: No module named 'requests.packages.urllib3

I use nginx on centos 7.3.

I installed certbot following https://certbot.eff.org/#centosrhel7-nginx

There is an error when running certbot --nginx:

 

 
  1. [root@demo src]# certbot --nginx

  2. Traceback (most recent call last):

  3. File "/usr/bin/certbot", line 9, in <module>

  4. load_entry_point('certbot==0.14.1', 'console_scripts', 'certbot')()

  5. File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 564, in load_entry_point

  6. return get_distribution(dist).load_entry_point(group, name)

  7. File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2662, in load_entry_point

  8. return ep.load()

  9. File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2316, in load

  10. return self.resolve()

  11. File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2322, in resolve

  12. module = __import__(self.module_name, fromlist=['__name__'], level=0)

  13. File "/usr/lib/python2.7/site-packages/certbot/main.py", line 14, in <module>

  14. from certbot import account

  15. File "/usr/lib/python2.7/site-packages/certbot/account.py", line 17, in <module>

  16. from acme import messages

  17. File "/usr/lib/python2.7/site-packages/acme/messages.py", line 4, in <module>

  18. from acme import challenges

  19. File "/usr/lib/python2.7/site-packages/acme/challenges.py", line 10, in <module>

  20. import requests

  21. File "/usr/lib/python2.7/site-packages/requests/__init__.py", line 58, in <module>

  22. from . import utils

  23. File "/usr/lib/python2.7/site-packages/requests/utils.py", line 32, in <module>

  24. from .exceptions import InvalidURL

  25. File "/usr/lib/python2.7/site-packages/requests/exceptions.py", line 10, in <module>

  26. from .packages.urllib3.exceptions import HTTPError as BaseHTTPError

  27. File "/usr/lib/python2.7/site-packages/requests/packages/__init__.py", line 95, in load_module

  28. raise ImportError("No module named '%s'" % (name,))

  29. ImportError: No module named 'requests.packages.urllib3'

解决方法:

trypip install --upgrade --force-reinstall 'requests==2.6.0' urllib3 , I've had the same problem https://niuhp.com/other/https-certbot.html

  • 0
    点赞
  • 0
    收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
©️2022 CSDN 皮肤主题:技术黑板 设计师:CSDN官方博客 返回首页
评论
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值