Python 3.13.2环境安装stringcase包失败但3.12.9可成功的问题求助及原因排查
Python 3.13.2环境安装stringcase包失败但3.12.9可成功的问题求助及原因排查
我最近在Ubuntu系统的Python 3.13.2虚拟环境里,尝试安装那个看起来已经没人维护的stringcasePython包,操作步骤如下:
python3.13 -m venv venv source venv/bin/activate pip install -U pip pip install stringcase
但安装过程中却弹出了下面的错误:
Collecting stringcase Using cached stringcase-1.2.0.tar.gz (3.0 kB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [35 lines of output] Traceback (most recent call last): File "/home/fgoudreault/venv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module> main() ~~~~^^ File "/home/fgoudreault/venv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main json_out["return_val"] = hook(**hook_input["kwargs"]) ~~~~^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/fgoudreault/venv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel return hook(config_settings) File "/tmp/pip-build-env-9bqsrgl1/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 334, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=[]) ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-9bqsrgl1/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 304, in _get_build_requires self.run_setup() ~~~~~~~~~~~~~~^^ File "/tmp/pip-build-env-9bqsrgl1/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 522, in run_setup super().run_setup(setup_script=setup_script) ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-9bqsrgl1/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 320, in run_setup exec(code, locals()) ~~~~^^^^^^^^^^^^^^^^ File "<string>", line 3, in <module> File "/tmp/pip-build-env-9bqsrgl1/overlay/lib/python3.13/site-packages/setuptools/_distutils/core.py", line 160, in setup dist.parse_config_files() ~~~~~~~~~~~~~~~~~~~~~~~^^ File "/tmp/pip-build-env-9bqsrgl1/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 730, in parse_config_files self._parse_config_files(filenames=inifiles) ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-9bqsrgl1/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 599, in _parse_config_files opt = self._enforce_underscore(opt, section) File "/tmp/pip-build-env-9bqsrgl1/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 629, in _enforce_underscore raise InvalidConfigError( ...<3 lines>... ) setuptools.errors.InvalidConfigError: Invalid dash-separated key 'description-file' in 'metadata' (setup.cfg), please use the underscore name 'description_file' instead. [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip.
有意思的是,如果我用Python 3.12.3版本创建虚拟环境,安装这个包就完全没问题。所以我猜测问题应该出在安装相关的依赖库上,我试过降级setuptools,但没解决问题。更奇怪的是,这个包的仓库里的setup.cfg文件,根本没有报错里提到的那个有问题的description-file配置项啊!
我现在的疑问是:这个问题的根源到底是什么?为什么会出现这种情况?
备注:内容来源于stack exchange,提问作者fgoudra
相关产品推荐
相关产品推荐

