Certbot :ImportError: No module named 'requests.packages.urllib3 Certbot :ImportError: No module named 'requests.packages.urllib3 nginx nginx

Certbot :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


It's because of the installation failure of "python-urllib3.noarch" :

$ sudo yum install python2-certbot-nginx...  Installing : python-urllib3-1.10.2-5.el7.noarch                                                                                                                                                     11/37 Error unpacking rpm package python-urllib3-1.10.2-5.el7.noarcherror: unpacking of archive failed on file /usr/lib/python2.7/site-packages/urllib3/packages/ssl_match_hostname: cpio: rename...Installed:  python2-certbot-nginx.noarch 0:0.27.1-1.el7                                                                                                                                                               Dependency Installed:  audit-libs-python.x86_64 0:2.8.1-3.el7_5.1          certbot.noarch 0:0.27.1-1.el7...Failed:  python-urllib3.noarch 0:1.10.2-5.el7

Solution:

According to error messages as above, just rename that dir "ssl_match_hostname"(in /usr/lib/python2.7/site-packages/urllib3/packages/), like to "ssl_match_hostname.old",and you may remove the new generated link(e.g: "ssl_match_hostname;5bf4fd46"), theninstall the python-urllib3.noarch again. And this works for me.