src / Xerces.cpp:13:10:致命错误:dom / DOMAttr.h:没有此类文件或目录

时间:2019-06-19 12:45:14

标签: python pip xquery ubuntu-18.04 pypi

我正在尝试安装PyExerces。但是我遇到了gcc编译错误。在Ubuntu中的python中这种事情正常吗?

(我几乎没有在Python中找到XQuery库,它是XQilla,XQilla需要PyExerces,而“ pip install PyXerces”给出了以下错误。 还有用于python Xquery lib的Zorba。但这是一个过时的旧项目,其必需的软件包不再适用于Ubuntu 18。 python发生了什么? :)无法找到适用于Python的XQuery库非常令人失望。)

erhan@erhan-VirtualBox:~$ sudo pip install PyXerces
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
WARNING: The directory '/home/erhan/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
WARNING: The directory '/home/erhan/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting PyXerces
  Downloading https://files.pythonhosted.org/packages/bf/64/421bc05f5b679ba95cc9bde319ad824406fa5522bef3621ba9125edf16bf/PyXerces-0.0.1.tar.gz (122kB)
     |████████████████████████████████| 122kB 773kB/s 
Installing collected packages: PyXerces
  Running setup.py install for PyXerces ... error
    ERROR: Complete output from command /usr/bin/python2.7 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-FNousf/PyXerces/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-56rydK/install-record.txt --single-version-externally-managed --compile:
    ERROR: running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/Xerces
    copying Xerces/etree.py -> build/lib.linux-x86_64-2.7/Xerces
    copying Xerces/__init__.py -> build/lib.linux-x86_64-2.7/Xerces
    creating build/lib.linux-x86_64-2.7/Xerces/util
    copying Xerces/util/__init__.py -> build/lib.linux-x86_64-2.7/Xerces/util
    copying Xerces/util/XMLUniDefs.py -> build/lib.linux-x86_64-2.7/Xerces/util
    running build_ext
    building 'Xerces.__Xerces' extension
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/src
    creating build/temp.linux-x86_64-2.7/src/util
    creating build/temp.linux-x86_64-2.7/src/common
    creating build/temp.linux-x86_64-2.7/src/internal
    creating build/temp.linux-x86_64-2.7/src/framework
    creating build/temp.linux-x86_64-2.7/src/framework/psvi
    creating build/temp.linux-x86_64-2.7/src/parsers
    creating build/temp.linux-x86_64-2.7/src/dom
    creating build/temp.linux-x86_64-2.7/src/sax
    creating build/temp.linux-x86_64-2.7/src/validators
    creating build/temp.linux-x86_64-2.7/src/validators/common
    creating build/temp.linux-x86_64-2.7/src/validators/DTD
    creating build/temp.linux-x86_64-2.7/src/validators/schema
    creating build/temp.linux-x86_64-2.7/src/validators/schema/identity
    creating build/temp.linux-x86_64-2.7/src/validators/datatype
    creating build/temp.linux-x86_64-2.7/src/sax2
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-MW0004/python2.7-2.7.15=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/include -I/usr/include/python2.7 -c src/Xerces.cpp -o build/temp.linux-x86_64-2.7/src/Xerces.o -std=c++0x
    src/Xerces.cpp:13:10: fatal error: dom/DOMAttr.h: No such file or directory
     #include "dom/DOMAttr.h"
              ^~~~~~~~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command "/usr/bin/python2.7 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-FNousf/PyXerces/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-56rydK/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-FNousf/PyXerces/

1 个答案:

答案 0 :(得分:0)

2014年发布的0.0.1版。您确定该软件包可用吗?反正...

这是程序包中的错误。 distribution at PyPI包含Python源代码和C ++文件,但不包含文件。标头在the repository中可用。尝试直接从Github安装:

pip install git+https://github.com/mugwort-rc/pyXerces.git#egg=pyXerces

您需要一些其他依赖项。当编译开始需要Boost库时,我停了下来。