frescobaldi/python-poppler-qt5

Not compilable

Closed this issue · 5 comments

Hello Guys,

i even don't know what i'm doing wrong, but i have the same issue on two different systems (Debian as well as Gentoo):

Installing collected packages: python-poppler-qt5
  Running setup.py install for python-poppler-qt5
    building 'popplerqt5' extension
    /usr/bin/sip -I /usr/share/sip -t POPPLER_V0_20_0 -c build/temp.linux-x86_64-3.4 -b build/temp.linux-x86_64-3.4/poppler-qt5.sbf -I /usr/share/sip/PyQt5 -t WS_X11 -t Qt_5_4_1 poppler-qt5.sip
    sip: QDomElement is undefined
    Can't determine version of poppler-qt5
    error: command '/usr/bin/sip' failed with exit status 1
    Complete output from command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-h3ed8rd_/python-poppler-qt5/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-qufom6di-record/install-record.txt --single-version-externally-managed --compile:
    running install

    running build

    running build_ext

    building 'popplerqt5' extension

    /usr/bin/sip -I /usr/share/sip -t POPPLER_V0_20_0 -c build/temp.linux-x86_64-3.4 -b build/temp.linux-x86_64-3.4/poppler-qt5.sbf -I /usr/share/sip/PyQt5 -t WS_X11 -t Qt_5_4_1 poppler-qt5.sip

    sip: QDomElement is undefined

    Can't determine version of poppler-qt5

    error: command '/usr/bin/sip' failed with exit status 1

    ----------------------------------------
    Command "/usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-h3ed8rd_/python-poppler-qt5/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-qufom6di-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-h3ed8rd_/python-poppler-qt5

I have installed Qt 5.4.1 and also PyQt 5.4.1. For SIP i've installed version 4.16.7.

Did i missed something? How can i resolve that issue? If i'm removing the QDomElement parts (because i even don't need the annotation feature), he misses the QDomDocument and so on. But i can import these elements without any problems.

Especially on gentoo i can ensure that the qtxml part is also installed. To get it compiled i now said the setup.py that i don't have qtxml installed. But it is not really beautiful.

Thanks and Regards,
Lukas

Is the PyQt5.QtXml module importable in python3?

Yes, thats possible:

Python 3.4.2 (default, Nov  1 2014, 11:37:12) 
[GCC 4.8.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt5.QtXml
>>> vars(PyQt5.QtXml)
{'QDomNotation': <class 'PyQt5.QtXml.QDomNotation'>, 'QDomAttr': <class 'PyQt5.QtXml.QDomAttr'>, 'QXmlDeclHandler': <class 'PyQt5.QtXml.QXmlDeclHandler'>, '__loader__': <_frozen_importlib.ExtensionFileLoader object at 0x7ff569111160>, 'QDomEntityReference': <class 'PyQt5.QtXml.QDomEntityReference'>, 'QDomCDATASection': <class 'PyQt5.QtXml.QDomCDATASection'>, 'QXmlLexicalHandler': <class 'PyQt5.QtXml.QXmlLexicalHandler'>, 'QDomProcessingInstruction': <class 'PyQt5.QtXml.QDomProcessingInstruction'>, 'QDomComment': <class 'PyQt5.QtXml.QDomComment'>, 'QDomDocument': <class 'PyQt5.QtXml.QDomDocument'>, 'QDomDocumentFragment': <class 'PyQt5.QtXml.QDomDocumentFragment'>, 'QDomNamedNodeMap': <class 'PyQt5.QtXml.QDomNamedNodeMap'>, '__file__': '/usr/lib64/python3.4/site-packages/PyQt5/QtXml.so', 'QXmlLocator': <class 'PyQt5.QtXml.QXmlLocator'>, '__doc__': None, 'QXmlDTDHandler': <class 'PyQt5.QtXml.QXmlDTDHandler'>, 'QDomText': <class 'PyQt5.QtXml.QDomText'>, 'QXmlAttributes': <class 'PyQt5.QtXml.QXmlAttributes'>, 'QXmlNamespaceSupport': <class 'PyQt5.QtXml.QXmlNamespaceSupport'>, '__package__': 'PyQt5', 'QXmlErrorHandler': <class 'PyQt5.QtXml.QXmlErrorHandler'>, 'QXmlParseException': <class 'PyQt5.QtXml.QXmlParseException'>, 'QXmlContentHandler': <class 'PyQt5.QtXml.QXmlContentHandler'>, 'QDomDocumentType': <class 'PyQt5.QtXml.QDomDocumentType'>, 'QXmlReader': <class 'PyQt5.QtXml.QXmlReader'>, '__name__': 'PyQt5.QtXml', 'QXmlDefaultHandler': <class 'PyQt5.QtXml.QXmlDefaultHandler'>, 'QDomNodeList': <class 'PyQt5.QtXml.QDomNodeList'>, 'QXmlInputSource': <class 'PyQt5.QtXml.QXmlInputSource'>, 'QDomImplementation': <class 'PyQt5.QtXml.QDomImplementation'>, 'QDomElement': <class 'PyQt5.QtXml.QDomElement'>, 'QDomEntity': <class 'PyQt5.QtXml.QDomEntity'>, 'QXmlSimpleReader': <class 'PyQt5.QtXml.QXmlSimpleReader'>, '__spec__': ModuleSpec(name='PyQt5.QtXml', loader=<_frozen_importlib.ExtensionFileLoader object at 0x7ff569111160>, origin='/usr/lib64/python3.4/site-packages/PyQt5/QtXml.so'), 'QDomNode': <class 'PyQt5.QtXml.QDomNode'>, 'QDomCharacterData': <class 'PyQt5.QtXml.QDomCharacterData'>, 'QXmlEntityResolver': <class 'PyQt5.QtXml.QXmlEntityResolver'>}

Also QDomElement and QDomDocument:

>>> from PyQt5.QtXml import QDomElement, QDomDocument
>>> 

I'm having the same problem running it on windows 8.1, Qt 5.4.1, SIP 4.16.7, python 3.4.3. I can also import and run the same commands @monofox can

Just a quick & dirty fix:

diff -bru python-poppler-qt5-0.24.2/setup.py python-poppler-qt5-0.24.2-noxml/setup.py
--- setup.py    2015-02-27 09:42:38.000000000 +0000
+++ setup.py    2015-06-10 15:09:26.496750059 +0000
@@ -276,7 +276,7 @@
             cmd += ['-I', self._sip_sipfiles_dir()]
         if tag:
             cmd += ['-t', tag]
-        if not check_qtxml():
+        if True:
             cmd += ["-x", "QTXML_AVAILABLE"]     # mark QtXml not supported
         cmd += [
             "-c", self.build_temp,

@zehome, thank you for your suggested quick fix. I ran into the same problem myself while trying to package python-poppler-qt5 for Debian, and wouldn't have had a clue where to start looking to solve this problem.

Thanks to your helpful clues, I think I have come up with a proper fix in Pull Request #3. If you have time, please test and see if it works for you too.