Cannot uninstall ‘pytz‘.It is a distutils installed project and thus we cannot accurately determi...

文章目录

  • 问题描述:
  • 解决办法:
      • 方法一:
      • 方法二:
      • 方法三:
      • 附录:
        • python pip install 操作及问题汇总
        • python pip镜像

问题描述:

升级pandas的时候出现下面的报错。
ERROR:Cannot uninstall ‘pytz’. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial unistall. 即无法卸载这个包。原因可能是之前的第三方库是通过离线文件方式安装的, 删除相应的egg-info后可以尝试解决。
在升级其他包的时候也可能会遇到类似的问题。解决方法是一样的。
Cannot uninstall ‘pytz‘.It is a distutils installed project and thus we cannot accurately determi..._第1张图片

解决办法:

方法一:

在Anaconda目录下找到site-packages文件夹,如D:\Anaconda\Lib\site-packages,找到下图中的文件,删除。Cannot uninstall ‘pytz‘.It is a distutils installed project and thus we cannot accurately determi..._第2张图片
删除后,再重新安装升级pandas
Cannot uninstall ‘pytz‘.It is a distutils installed project and thus we cannot accurately determi..._第3张图片
安装成功后,在D:\Anaconda\Lib\site-packages目录下会出现下图中的文件夹,之后一切正常。
Cannot uninstall ‘pytz‘.It is a distutils installed project and thus we cannot accurately determi..._第4张图片

方法二:

linux上可以强制安装
sudo pip install pyqt --upgrade --ignore-installed pyqt
参考:https://www.cnblogs.com/qq952693358/p/9425544.html

方法三:

网上下载相应的安装包
下载好对应版本的 whl文件,在下载文件下,打开终端,输入 “pip install xxx.whl” 显示安装成功。
备注:方法一是本人用的方法,觉的比较便捷,大家也可以用方法二和三。

附录:

python pip install 操作及问题汇总

python pip install 操作及问题汇总

python pip镜像

python pip镜像

你可能感兴趣的:(Python,python)