如何解决 ImportError: 没有名为 certifi 的模块

如何解决 ImportError: 没有名为 certifi 的模块

我正在使用 Debian Testing,并尝试安装几个模块,其中一个是 discog 客户端。但是我一直遇到这个 certifi 问题,我对此一无所知。

根据我的python安装,certifi 模块已在系统中. 参见下文。

python

Python 2.7.15 (default, May  1 2018, 05:55:50) 
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import certifi
>>> certifi.where()
'/etc/ssl/certs/ca-certificates.crt'

这是错误。

pip install discogs-client

File "/usr/local/bin/pip", line 7, in <module>
    from pip._internal import main
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/__init__.py", line 42, in <module>
    from pip._internal import cmdoptions
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/cmdoptions.py", line 16, in <module>
    from pip._internal.index import (
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/index.py", line 15, in <module>
    from pip._vendor import html5lib, requests, six
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py", line 99, in <module>
    from . import utils
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/utils.py", line 24, in <module>
    from . import certs
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/certs.py", line 15, in <module>
    from pip._vendor.certifi import where
ImportError: No module named certifi

这是 pip install certifi

pip install certifi
Traceback (most recent call last):
  File "/usr/local/bin/pip", line 7, in <module>
    from pip._internal import main
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/__init__.py", line 42, in <module>
    from pip._internal import cmdoptions
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/cmdoptions.py", line 16, in <module>
    from pip._internal.index import (
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/index.py", line 15, in <module>
    from pip._vendor import html5lib, requests, six
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py", line 99, in <module>
    from . import utils
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/utils.py", line 24, in <module>
    from . import certs
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/certs.py", line 15, in <module>
    from pip._vendor.certifi import where
ImportError: No module named certifi

相关内容