我正在刷新我的系统,安装新版 Fedora 37(从 36 升级)。一切顺利,我开始安装我使用的软件包。一切都很顺利,直到我尝试使用 pip 安装 XMLSTARLET。该命令的疯狂输出如下所示:
Collecting xmlstarlet
Downloading xmlstarlet-1.6.8.tar.gz (715 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 715.3/715.3 kB 8.7 MB/s eta 0:00:00
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 2
╰─> [230 lines of output]
/usr/lib/python3.11/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
warnings.warn(
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
patching file xmlstarlet/src/trans.c
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file xmlstarlet/src/trans.c.rej
patching file xmlstarlet/src/xml.c
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
15 out of 15 hunks ignored -- saving rejects to file xmlstarlet/src/xml.c.rej
patching file xmlstarlet/src/xml_C14N.c
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
8 out of 8 hunks ignored -- saving rejects to file xmlstarlet/src/xml_C14N.c.rej
patching file xmlstarlet/src/xml_depyx.c
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
5 out of 5 hunks ignored -- saving rejects to file xmlstarlet/src/xml_depyx.c.rej
patching file xmlstarlet/src/xml_edit.c
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
22 out of 22 hunks ignored -- saving rejects to file xmlstarlet/src/xml_edit.c.rej
patching file xmlstarlet/src/xml_elem.c
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
6 out of 6 hunks ignored -- saving rejects to file xmlstarlet/src/xml_elem.c.rej
patching file xmlstarlet/src/xml_escape.c
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
4 out of 4 hunks ignored -- saving rejects to file xmlstarlet/src/xml_escape.c.rej
patching file xmlstarlet/src/xml_format.c
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
6 out of 6 hunks ignored -- saving rejects to file xmlstarlet/src/xml_format.c.rej
patching file xmlstarlet/src/xml_ls.c
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
3 out of 3 hunks ignored -- saving rejects to file xmlstarlet/src/xml_ls.c.rej
patching file xmlstarlet/src/xml_pyx.c
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
3 out of 3 hunks ignored -- saving rejects to file xmlstarlet/src/xml_pyx.c.rej
patching file xmlstarlet/src/xml_select.c
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
18 out of 18 hunks ignored -- saving rejects to file xmlstarlet/src/xml_select.c.rej
patching file xmlstarlet/src/xml_trans.c
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
9 out of 9 hunks ignored -- saving rejects to file xmlstarlet/src/xml_trans.c.rej
patching file xmlstarlet/src/xml_validate.c
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
7 out of 7 hunks ignored -- saving rejects to file xmlstarlet/src/xml_validate.c.rej
Compiling xmlstarlet C sources...
make all-am
make[1]: Entering directory '/tmp/pip-install-fe6qmovj/xmlstarlet_c48ea51fb5f3402f9d7bbde3cdb34c0c/xmlstarlet'
CC src/trans.o
CC src/xml_C14N.o
CC src/xml_depyx.o
CC src/xml_edit.o
CC src/xml_elem.o
CC src/xml_escape.o
CC src/xml_format.o
CC src/xml_ls.o
CC src/xml_select.o
CC src/xml_pyx.o
CC src/xml_validate.o
CC src/usage.o
CC src/depyx-usage.o
CC src/xml_trans.o
CC src/c14n-usage.o
CC src/escape-usage.o
CC src/format-usage.o
CC src/edit-usage.o
CC src/elem-usage.o
CC src/select-usage.o
CC src/ls-usage.o
CC src/pyx-usage.o
CC src/unescape-usage.o
CC src/trans-usage.o
CC src/validate-usage.o
src/xml_C14N.c:12:10: fatal error: libxml/xmlversion.h: No such file or directory
12 | #include <libxml/xmlversion.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
src/xml_elem.c:31:10: fatal error: libxml/xmlstring.h: No such file or directory
31 | #include <libxml/xmlstring.h>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from src/trans.c:4:
src/trans.h:32:10: fatal error: libxml/xmlmemory.h: No such file or directory
32 | #include <libxml/xmlmemory.h>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:936: src/xml_C14N.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:936: src/xml_elem.o] Error 1
make[1]: *** [Makefile:936: src/trans.o] Error 1
src/pyx-usage.c:2:10: fatal error: libxml/xmlversion.h: No such file or directory
2 | #include <libxml/xmlversion.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
src/usage.c:2:10: fatal error: libxml/xmlversion.h: No such file or directory
2 | #include <libxml/xmlversion.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
src/trans-usage.c:2:10: fatal error: libxml/xmlversion.h: No such file or directory
2 | #include <libxml/xmlversion.h>
| ^~~~~~~~~~~~~~~~~~~~~
make[1]: *** [Makefile:936: src/pyx-usage.o] Error 1
make[1]: *** [Makefile:936: src/usage.o] Error 1
src/c14n-usage.c:2:10: fatal error: libxml/xmlversion.h: No such file or directory
2 | #include <libxml/xmlversion.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
src/edit-usage.c:2:10: fatal error: libxml/xmlversion.h: No such file or directory
2 | #include <libxml/xmlversion.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
src/select-usage.c:2:10: fatal error: libxml/xmlversion.h: No such file or directory
2 | #include <libxml/xmlversion.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
src/ls-usage.c:2:10: fatal error: libxml/xmlversion.h: No such file or directory
2 | #include <libxml/xmlversion.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:936: src/c14n-usage.o] Error 1
src/format-usage.c:2:10: fatal error: libxml/xmlversion.h: No such file or directory
2 | #include <libxml/xmlversion.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:936: src/edit-usage.o] Error 1
compilation terminated.
make[1]: *** [Makefile:936: src/select-usage.o] Error 1
make[1]: *** [Makefile:936: src/format-usage.o] Error 1
src/xml_pyx.c:19:10: fatal error: libxml/parser.h: No such file or directory
19 | #include <libxml/parser.h>
| ^~~~~~~~~~~~~~~~~
compilation terminated.
src/elem-usage.c:2:10: fatal error: libxml/xmlversion.h: No such file or directory
2 | #include <libxml/xmlversion.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:936: src/trans-usage.o] Error 1
src/xml_depyx.c:33:10: fatal error: libxml/xmlmemory.h: No such file or directory
33 | #include <libxml/xmlmemory.h>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:936: src/ls-usage.o] Error 1
src/unescape-usage.c:2:10: fatal error: libxml/xmlversion.h: No such file or directory
2 | #include <libxml/xmlversion.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:936: src/xml_pyx.o] Error 1
src/validate-usage.c:2:10: fatal error: libxml/xmlversion.h: No such file or directory
2 | #include <libxml/xmlversion.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:936: src/elem-usage.o] Error 1
make[1]: *** [Makefile:936: src/xml_depyx.o] Error 1
src/depyx-usage.c:2:10: fatal error: libxml/xmlversion.h: No such file or directory
2 | #include <libxml/xmlversion.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
src/xml_edit.c:35:10: fatal error: libxml/xmlmemory.h: No such file or directory
35 | #include <libxml/xmlmemory.h>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:936: src/unescape-usage.o] Error 1
make[1]: *** [Makefile:936: src/validate-usage.o] Error 1
make[1]: *** [Makefile:936: src/xml_edit.o] Error 1
make[1]: *** [Makefile:936: src/depyx-usage.o] Error 1
In file included from src/xml_trans.c:35:
src/xmlstar.h:15:10: fatal error: libxml/xpath.h: No such file or directory
15 | #include <libxml/xpath.h>
| ^~~~~~~~~~~~~~~~
compilation terminated.
In file included from src/xml_validate.c:35:
src/xmlstar.h:15:10: fatal error: libxml/xpath.h: No such file or directory
15 | #include <libxml/xpath.h>
| ^~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:936: src/xml_trans.o] Error 1
make[1]: *** [Makefile:936: src/xml_validate.o] Error 1
src/escape-usage.c:2:10: fatal error: libxml/xmlversion.h: No such file or directory
2 | #include <libxml/xmlversion.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
src/xml_escape.c:36:10: fatal error: libxml/xmlmemory.h: No such file or directory
36 | #include <libxml/xmlmemory.h>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
src/xml_select.c:38:10: fatal error: libxml/tree.h: No such file or directory
38 | #include <libxml/tree.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:936: src/escape-usage.o] Error 1
make[1]: *** [Makefile:936: src/xml_select.o] Error 1
make[1]: *** [Makefile:936: src/xml_escape.o] Error 1
src/xml_format.c:35:10: fatal error: libxml/xmlmemory.h: No such file or directory
35 | #include <libxml/xmlmemory.h>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:936: src/xml_format.o] Error 1
src/xml_ls.c:40:10: fatal error: libxml/xmlmemory.h: No such file or directory
40 | #include <libxml/xmlmemory.h>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:936: src/xml_ls.o] Error 1
make[1]: Leaving directory '/tmp/pip-install-fe6qmovj/xmlstarlet_c48ea51fb5f3402f9d7bbde3cdb34c0c/xmlstarlet'
make: *** [Makefile:718: all] Error 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
$ python --version
Python 3.11.1pip --version
$ pip 22.3.1 from /usr/lib/python3.11/site-packages/pip (python 3.11)
$ pip install --upgrade --user setuptools
Requirement already satisfied: setuptools in ./.local/lib/python3.11/site-packages (65.6.3)
dnf list xmlstarlet libxslt
Installed Packages
libxslt.x86_64 1.1.37-1.fc37
xmlstarlet.x86_64 1.6.1-20.fc37
我做了一些研究,在其他地方找不到这个问题。我尝试在虚拟机中重新安装,但并没有解决问题。我尝试升级我能找到的,但仍然出现相同的错误。我假设一个简单的问题触发了这一切,但我无法弄清楚。我的问题是我需要做什么来解决这个问题?
答案1
看看xmlstarlet 的 pypi 项目页面,你可以看到有最高到 python 3.10cp310
的二进制版本( )。目前 Fedora 37 使用的最新版本 3.11 没有二进制版本。
Pip 尝试从源代码构建包,但失败了。直接原因似乎是您缺少 libxml 开发文件(最有可能在 中libxml2-devel
),但 xmlstarlet 的变更日志停止支持 python 3.10,并且查看前几行输出,我不确定它是否正确打包为源代码构建(但我可能是错的)。
您可能需要等待 xmlstarlet 包维护者支持 python 3.11,或者自行修补项目。