DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no

Posted 鸿渐之翼

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no相关的知识,希望对你有一定的参考价值。

讨论下我今天遇到的问题,在macOS catlina系统上使用pip3安装库时,遇到了
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.
它这个错误是什么呢?我大致翻译下。
弃用:不推荐使用 distutils 配置文件配置安装方案,并且在不久的将来将不再起作用。 如果您使用的是 Homebrew 或 Linuxbrew Python。

我最初使用brew安装的pip3与pip2,也尝试通过脚本安装过,pip install xxx能提示成功安装,但是我在用python import导入的时候存在问题。为了解决这个问题,记录下过程。

官方给出的解决方案是去GitHub上看:Github关于PIP在MAC上的讨论
https://github.com/Homebrew/homebrew-core/issues/76621


If you have been directed here from a pip warning, you don’t need to take any action at this stage. Nothing is currently expected to break until Python 3.12, and a full solution will be implemented well before then.

如果您是从 pip 警告中被引导到这里的,则在此阶段您无需采取任何措施。 目前预计在 Python 3.12 之前不会有任何问题,完整的解决方案将在此之前很好地实现。

I am one of the maintainers of pip, the Python package installer. We are recently informed that Homebrew is currently using distutils.cfg to configure package installation schemes, and we believe it is best for Homebrew to remove the usage.
Python is currently deprecating distutils, and will remove the module entirely in 3.10 (PEP 632). As a part of the transition, pip is moving all its current distutils usages to the sysconfig module instead, and a user recently reported pip would no longer work correctly with Homebrew-compiled Python after the transision. This is due to Homebrew’s usage of distutils.cfg, which is no longer supported in sysconfig.
The distutils.cfg file (and its various variants) has long been disfavoured by Python core maintainers, and the recommendation, if redistributors wish to provide custom install schemes, has been to directly patch distutils and sysconfig instead. This is the current approach taken by all Linux distributions that we have contact with, and the community is working toward providing better support to the patching process (b.p.o-43976). I’m recommending Homebrew to also migrate away from the distutils.cfg usage, since it is going to break while the community continuously migrate away from distutils, and stop working entirely when Python 3.12 lands, and join the conversation with other Python redistributors to improve sysconfig to support Homebrew’s needs.

我是 pip(Python 包安装程序)的维护者之一。我们最近得知 Homebrew 目前正在使用 distutils.cfg 来配置软件包安装方案,我们认为 Homebrew 最好删除该用法。
Python 目前正在弃用 distutils,并将在 3.10 (PEP 632) 中完全删除该模块。作为过渡的一部分,pip 将其所有当前的 distutils 用法移到 sysconfig 模块,并且用户最近报告说,在过渡后 pip 将不再与 Homebrew 编译的 Python 正常工作。这是由于 Homebrew 使用了 sysconfig 不再支持的 distutils.cfg。
distutils.cfg 文件(及其各种变体)长期以来一直受到 Python 核心维护者的反对,如果再发行商希望提供自定义安装方案,建议直接修补 distutils 和 sysconfig。这是我们接触过的所有 Linux 发行版当前采用的方法,社区正在努力为修补过程提供更好的支持 (b.p.o-43976)。我建议 Homebrew 也从 distutils.cfg 的使用中迁移出来,因为当社区不断从 distutils 迁移时它会崩溃,并在 Python 3.12 登陆时完全停止工作,并加入与其他 Python 再分发者的对话以改进sysconfig 来支持 Homebrew 的需求。

Reposting here so it won’t get buried in the Discussions page. We probably want to fix python@3.9 so it can be easily re-used for python@3.10
在这里重新发布,这样它就不会被埋没在讨论页面中。 我们可能想要修复 python@3.9 以便它可以轻松地重新用于 python@3.10

下面关于讨论我们这里就省略了,大致意思是pip团队放弃了支持Mac的平台,因为homebrew与pip不支持了。pip在Mac上成了烂尾楼项目。我目前的想法是把程序迁移到Linux上去,然后Linux运行python,但重新配置Linux基本环境也需要一段时间

以上是关于DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no的主要内容,如果未能解决你的问题,请参考以下文章

为啥在 django.utils.deprecation.py 中声明中间件 mixin

ModuleNotFoundError:没有名为“zope.deprecation”的模块

@SuppressWarnings("deprecation")

@SuppressWarnings("deprecation") 和 ("unused") 在 Java 中是啥意思?

错误:Thor:Class 的未定义方法“deprecation_warning”

使用 pyinstaller 构建 exe 时未找到 APScheduler pytz-deprecation-shim