问题描述

        Installing collected packages: opt-einsum, six, astunparse, absl-py, flatbuffers, keras-preprocessing, protobuf, grpcio, oauthlib, urllib3, charset-normalizer, idna, certifi, requests, requests-oauthlib, pyasn1, rsa, pyasn1-modules, cachetools, google-auth, google-auth-oauthlib, dataclasses, werkzeug, tensorboard-plugin-wit, tensorboard-data-server, zipp, typing-extensions, importlib-metadata, markdown, tensorboard, wrapt, gast, keras, clang, google-pasta, cached-property, h5py, termcolor, tensorflow-estimator, tensorflow
  Attempting uninstall: six
    Found existing installation: six 1.16.0
    Uninstalling six-1.16.0:
      Successfully uninstalled six-1.16.0
  Attempting uninstall: certifi
    Found existing installation: certifi 2016.9.26
ERROR: Cannot uninstall 'certifi'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

解决办法

pip install certifi --ignore-installed

        如果解决不了的话还可以尝试: 

pip install xxx --ignore-installed certifi

        这里面我们可以看到两条指令都有ignore-installed关键字,其实我们回到这个报错信息就能明白了:由于'certifi'是通过distutils安装的,因此它的文件分布在多个位置,难以确定哪些文件属于它,因此无法完全地卸载它。 为了解决这个问题,你可以尝试使用pip命令重新安装'certifi',然后再卸载它 

        除了这种方式,还可以直接更新,也就是upgrade

pip install --upgrade --force-reinstall certifi

延伸阅读

        上述的方法来自以下两篇博客:

当安装python模块出现Cannot uninstall ‘certifi‘的解决方案_cannot uninstall 'certifi'. it is a distutils inst-CSDN博客文章浏览阅读9.8k次,点赞16次,收藏30次。1. 问题:当pip install xxx时,出现如下:Cannot uninstall 'certifi'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.2.解决方案:pip install xxx --ignore-installed.._cannot uninstall 'certifi'. it is a distutils installed project and thus wehttps://blog.csdn.net/pei327586354/article/details/108285285https://wenku.csdn.net/answer/2f7b7680402743968e5908180295b952#:~:text=%E7%94%B1%E4%BA%8E%27certifi%27%E6%98%AF%E9%80%9A%E8%BF%87distutils%E5%AE%89%E8%A3%85%E7%9A%84%EF%BC%8C%E5%9B%A0%E6%AD%A4%E5%AE%83%E7%9A%84%E6%96%87%E4%BB%B6%E5%88%86%E5%B8%83%E5%9C%A8%E5%A4%9A%E4%B8%AA%E4%BD%8D%E7%BD%AE%EF%BC%8C%E9%9A%BE%E4%BB%A5%E7%A1%AE%E5%AE%9A%E5%93%AA%E4%BA%9B%E6%96%87%E4%BB%B6%E5%B1%9E%E4%BA%8E%E5%AE%83%EF%BC%8C%E5%9B%A0%E6%AD%A4%E6%97%A0%E6%B3%95%E5%AE%8C%E5%85%A8%E5%9C%B0%E5%8D%B8%E8%BD%BD%E5%AE%83%E3%80%82,%E4%B8%BA%E4%BA%86%E8%A7%A3%E5%86%B3%E8%BF%99%E4%B8%AA%E9%97%AE%E9%A2%98%EF%BC%8C%E4%BD%A0%E5%8F%AF%E4%BB%A5%E5%B0%9D%E8%AF%95%E4%BD%BF%E7%94%A8pip%E5%91%BD%E4%BB%A4%E9%87%8D%E6%96%B0%E5%AE%89%E8%A3%85%27certifi%27%EF%BC%8C%E7%84%B6%E5%90%8E%E5%86%8D%E5%8D%B8%E8%BD%BD%E5%AE%83%E3%80%82icon-default.png?t=N7T8https://wenku.csdn.net/answer/2f7b7680402743968e5908180295b952#:~:text=%E7%94%B1%E4%BA%8E%27certifi%27%E6%98%AF%E9%80%9A%E8%BF%87distutils%E5%AE%89%E8%A3%85%E7%9A%84%EF%BC%8C%E5%9B%A0%E6%AD%A4%E5%AE%83%E7%9A%84%E6%96%87%E4%BB%B6%E5%88%86%E5%B8%83%E5%9C%A8%E5%A4%9A%E4%B8%AA%E4%BD%8D%E7%BD%AE%EF%BC%8C%E9%9A%BE%E4%BB%A5%E7%A1%AE%E5%AE%9A%E5%93%AA%E4%BA%9B%E6%96%87%E4%BB%B6%E5%B1%9E%E4%BA%8E%E5%AE%83%EF%BC%8C%E5%9B%A0%E6%AD%A4%E6%97%A0%E6%B3%95%E5%AE%8C%E5%85%A8%E5%9C%B0%E5%8D%B8%E8%BD%BD%E5%AE%83%E3%80%82,%E4%B8%BA%E4%BA%86%E8%A7%A3%E5%86%B3%E8%BF%99%E4%B8%AA%E9%97%AE%E9%A2%98%EF%BC%8C%E4%BD%A0%E5%8F%AF%E4%BB%A5%E5%B0%9D%E8%AF%95%E4%BD%BF%E7%94%A8pip%E5%91%BD%E4%BB%A4%E9%87%8D%E6%96%B0%E5%AE%89%E8%A3%85%27certifi%27%EF%BC%8C%E7%84%B6%E5%90%8E%E5%86%8D%E5%8D%B8%E8%BD%BD%E5%AE%83%E3%80%82

完结撒花

        人生总会有些污点,人这种生物,防尘能力太差了

        

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐