【问题标题】:ERROR: Cannot uninstall 'PyGObject'. It is a distutils installed project错误:无法卸载“PyGObject”。这是一个 distutils 安装的项目
【发布时间】:2021-11-18 16:56:59
【问题描述】:

我正在更新 PyGObject 并报错。

我应该如何更新 PyGObject

.....

环境:

macOS Big Sur 11.5.2

python --version
Python 3.9.7

pip --version
pip 21.2.4 from /usr/local/lib/python3.9/site-packages/pip (python 3.9)

我的操作。

错误:无法卸载“PyGObject”。这是一个 distutils 安装的项目,因此我们无法准确确定哪些文件属于它,这只会导致部分卸载。

pip install --upgrade PyGObject



DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
Requirement already satisfied: PyGObject in /usr/local/lib/python3.9/site-packages (3.40.1)
Collecting PyGObject
  Using cached PyGObject-3.42.0-cp39-cp39-macosx_11_0_x86_64.whl
Requirement already satisfied: pycairo>=1.16.0 in /usr/local/lib/python3.9/site-packages (from PyGObject) (1.20.1)
Installing collected packages: PyGObject
  Attempting uninstall: PyGObject
    Found existing installation: PyGObject 3.40.1
ERROR: Cannot uninstall 'PyGObject'. 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.

【问题讨论】:

    标签: python


    【解决方案1】:

    Pip 不确定要在升级中清理的软件包依赖项。您可以通过告诉它忽略已安装的内容来强制升级。

    pip install PyGObject --ignore-installed
    

    【讨论】:

    • PyGObject 3.40.1 还存在吗?根据操作,我更新到PyGObject-3.42.0
    • 为什么需要升级pygobject?您应该考虑使用 virtualenv。通常不应该触及系统python环境。
    • 您能在问题中添加一些上下文吗?
    猜你喜欢
    • 2019-05-17
    • 1970-01-01
    • 2018-10-12
    • 2020-08-24
    • 2018-10-29
    • 2021-12-29
    • 1970-01-01
    相关资源
    最近更新 更多