爆款云服务器低至4折,1核1G¥366/

阿里云最高1888元代金券领取
开源微信小程序商城 NideShop

CentOS 7 执行 certbot --nginx 报错,centos certbot 无法运行,错误信息如下:

Traceback (most recent call last):
  File "/usr/bin/certbot", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3138, in <module>
    @_call_aside
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3122, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3151, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 666, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 679, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 867, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'urllib3<1.23,>=1.21.1' distribution was not found and is required by requests

解决方法:

  • 先卸载
pip uninstall urllib3
pip uninstall requests
pip uninstall  chardet
  • 重新安装
pip install --upgrade --force-reinstall 'requests==2.6.0' urllib3

如果还是未解决请参考:Nginx 上配置 HTTPS 环境

标签: CentOS