[PyQt] pyuic4 problem

David Quinn daithiquinn at gmail.com
Fri Aug 6 14:55:54 BST 2010


I downloaded a new version of PyQt and SIP and reinstalled. PyQt4
appeared to be installed properly, as was pyuic4. However when I ran
the following command:

david$ pyuic4 -d window.ui > window.py

I go this error message:

Traceback (most recent call last):
  File "/Library/Python/2.6/site-packages/PyQt4/uic/port_v2/invoke.py",
line 12, in invoke
    exit_status = driver.invoke()
  File "/Library/Python/2.6/site-packages/PyQt4/uic/driver.py", line
37, in invoke
    self._generate()
  File "/Library/Python/2.6/site-packages/PyQt4/uic/driver.py", line
63, in _generate
    self._opts.pyqt3_wrapper)
  File "/Library/Python/2.6/site-packages/PyQt4/uic/__init__.py", line
128, in compileUi
    winfo = compiler.UICompiler().compileUi(uifile, pyfile)
  File "/Library/Python/2.6/site-packages/PyQt4/uic/Compiler/compiler.py",
line 66, in compileUi
    w = self.parse(input_stream)
  File "/Library/Python/2.6/site-packages/PyQt4/uic/uiparser.py", line
834, in parse
    document = parse(filename)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xml/etree/ElementTree.py",
line 862, in parse
    tree.parse(source, parser)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xml/etree/ElementTree.py",
line 586, in parse
    parser.feed(data)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xml/etree/ElementTree.py",
line 1245, in feed
    self._parser.Parse(data, 0)
ExpatError: mismatched tag: line 63, column 4

I don't understand what this means. Should I just delete all my python
files from the frameworks folder, and reinstall everything (a new
python install, etc)?



On Thu, Aug 5, 2010 at 10:45 PM, William Kyngesburye
<woklist at kyngchaos.com> wrote:
>
> On Aug 5, 2010, at 9:18 PM, David Quinn wrote:
>
>> Thanks for the advice, William.
>>
>> I followed the instructions for installation (though I could not find
>> all the files to delete).
>
> It's possible some files may be in /usr/bin and /usr/include.  (which files did you not find?)
>
>> I now received the following error message:
>>
>> david$ pyuic4
>> Traceback (most recent call last):
>>  File "/Library/Python/2.6/site-packages/PyQt4/uic/pyuic.py", line 4,
>> in <module>
>>    from PyQt4 import QtCore
>> ImportError: dlopen(/Library/Python/2.6/site-packages/PyQt4/QtCore.so,
>> 2): Symbol not found: _sipQtConnect
>>  Referenced from: /Library/Python/2.6/site-packages/PyQt4/QtCore.so
>>  Expected in: flat namespace
>> in /Library/Python/2.6/site-packages/PyQt4/QtCore.so
>>
>
> Just to make sure - rebuild *both* sip and pyqt, with clean source would help.  And Qt Cocoa is a must (not the Carbon version) for 64bit.  If your using Carbon, don't add --arch=x86_64 for SIP, and use the --use-arch=i386 option for PyQt.
>
> ... I didn't want to comment, but I also notice your use of Fink.  Are you running the system python or from Fink?
>
> My compile instructions should build both 32 abd 64bit SIP and PyQt, so it shouldn't matter if you somehow run Python 32bit instead of the default 64bit.  Check the binaries to make sure:
>
>  file /Library/Python/2.6/site-packages/PyQt4/QtCore.so
>  file /Library/Python/2.6/site-packages/sip.so
>
>> My .bash_profile looks like this:
>>
>> # Setting PATH for MacPython 2.6
>> # The orginal version is saved in .bash_profile.pysave
>> PATH="/System/Library/Frameworks/Python.framework/Versions/2.6/bin:${PATH}"
>> export PATH
>>
> No need if you use the /usr/local and /Library/Python install locations.
>
>
> P.S.  I also noticed your "qgis_scratch".  Are your developing a plugin for Qgis?  I make the "official" Qgis binaries which include a bundled Qt/PyQt, and if there is something that I could do with the distribution to help, let me know (like adding the sip/pyqt executables and includes).  I didn't think about that possibility. Though I do purposely strip out the Qt includes to save space.
>
> ... hmmmm ....
>
> -----
> William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
> http://www.kyngchaos.com/
>
> [Trillian]  What are you supposed to do WITH a maniacally depressed robot?
>
> [Marvin]  You think you have problems?  What are you supposed to do if you ARE a maniacally depressed robot?  No, don't try and answer, I'm 50,000 times more intelligent than you and even I don't know the answer...
>
> - HitchHiker's Guide to the Galaxy
>
>
>


More information about the PyQt mailing list