PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 1004 - Importing PySide.QtDeclarative and PySide.QtHelp into Autodesk Maya 2012 error
: Importing PySide.QtDeclarative and PySide.QtHelp into Autodesk Maya 2012 error
Status: WAITING
Product: PySide
Classification: Unclassified
Component: PySide
: 1.0.6
: PC MS Windows XP/Vista/7
: P4 normal
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2011-09-12 21:56 EEST by Tony Barbieri
Modified: 2011-09-16 13:02 EEST (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Barbieri 2011-09-12 21:56:25 EEST
I'm not sure the exact issue here but whenever I try and import either one of
those modules I get a DLL load failed error.  The reason I am putting this bug
here is that both of these modules work fine with PyQt4.  Also once I have
loaded them with PyQt4, I can then import the PySide modules and use them
without issue.  

The rest of the modules import fine (except PySide.QtWebKit but I am afraid
that is a maya issue as PyQt4 also is unable to use this module).
Comment 1 Hugo Parente Lima 2011-09-14 16:52:41 EEST
Marking as new, although we don't have how to test it due to the requirement of
a Maya copy.
Comment 2 renato filho 2011-09-14 17:12:37 EEST
this look like some missing library link, could you paste here the output of
ldd command for pyqt and pyside modules.

something like:

ldd /usr/local/lib/python2.7/dist-packages/PySide/QtHelp.so
Comment 3 Tony Barbieri 2011-09-14 17:34:17 EEST
QtHelp4.dll
 ntdll.dll => /cygdrive/c/Windows/SysWOW64/ntdll.dll (0x77b50000)
 kernel32.dll => /cygdrive/c/Windows/syswow64/kernel32.dll (0x76950000)
 KERNELBASE.dll => /cygdrive/c/Windows/syswow64/KERNELBASE.dll (0x75a50000)

QtDeclarative4.dll
 ntdll.dll => /cygdrive/c/Windows/SysWOW64/ntdll.dll (0x77b50000)
 kernel32.dll => /cygdrive/c/Windows/syswow64/kernel32.dll (0x76950000)
 KERNELBASE.dll => /cygdrive/c/Windows/syswow64/KERNELBASE.dll (0x75a50000)

These seem fine and match up with the PyQt distro that has these working.  I
understand this is a weird problem and hard to troubleshoot.  I can do any
testing to help.
Comment 4 renato filho 2011-09-14 17:40:23 EEST
this tests must be don in Python modules not in QtLibraries .
Comment 5 Tony Barbieri 2011-09-14 17:45:05 EEST
I attached Visual Studio to my Maya process to see if I could get any
information and here is what I got.  Hopefully it helps:

When I try and import PySide.QtDeclarative

'maya.exe': Loaded 'C:\Python26\Lib\site-packages\PySide\QtCore.pyd', Binary
was not built with debug information.
'maya.exe': Loaded 'C:\Python26\Lib\site-packages\PySide\pyside-python2.6.dll',
Binary was not built with debug information.
'maya.exe': Loaded
'C:\Python26\Lib\site-packages\PySide\shiboken-python2.6.dll', Binary was not
built with debug information.
'maya.exe': Loaded 'C:\Python26\Lib\site-packages\PySide\QtDeclarative.pyd',
Binary was not built with debug information.
'maya.exe': Loaded 'C:\Python26\Lib\site-packages\PySide\QtDeclarative4.dll',
Binary was not built with debug information.
'maya.exe': Loaded 'C:\Python26\Lib\site-packages\PySide\QtScript4.dll', Binary
was not built with debug information.
'maya.exe': Loaded 'C:\Python26\Lib\site-packages\PySide\QtSql4.dll', Binary
was not built with debug information.
'maya.exe': Loaded 'C:\Python26\Lib\site-packages\PySide\QtXmlPatterns4.dll',
Binary was not built with debug information.
First-chance exception at 0x77a3d7d8 in maya.exe: 0xC0000139: Entry Point Not
Found.
'maya.exe': Unloaded 'C:\Python26\Lib\site-packages\PySide\QtDeclarative.pyd'
'maya.exe': Unloaded 'C:\Python26\Lib\site-packages\PySide\QtDeclarative4.dll'
'maya.exe': Unloaded 'C:\Python26\Lib\site-packages\PySide\QtXmlPatterns4.dll'
'maya.exe': Unloaded 'C:\Python26\Lib\site-packages\PySide\QtSql4.dll'
'maya.exe': Unloaded 'C:\Python26\Lib\site-packages\PySide\QtScript4.dll'

When I load PyQt4.QtDeclarative

'maya.exe': Loaded 'C:\Python26\Lib\site-packages\PyQt4\QtDeclarative.pyd',
Binary was not built with debug information.
'maya.exe': Loaded 'C:\Program Files\Autodesk\Maya2012\bin\QtDeclarative4.dll'
'maya.exe': Loaded 'C:\Program Files\Autodesk\Maya2012\bin\QtScript4.dll'
'maya.exe': Loaded 'C:\Program Files\Autodesk\Maya2012\bin\QtSql4.dll'
'maya.exe': Loaded 'C:\Program Files\Autodesk\Maya2012\bin\QtXmlPatterns4.dll'
'maya.exe': Loaded 'C:\Python26\Lib\site-packages\sip.pyd', Binary was not
built with debug information.
'maya.exe': Loaded 'C:\Python26\Lib\site-packages\PyQt4\QtCore.pyd', Binary was
not built with debug information.
'maya.exe': Loaded 'C:\Python26\Lib\site-packages\PyQt4\QtNetwork.pyd', Binary
was not built with debug information.
'maya.exe': Loaded 'C:\Python26\Lib\site-packages\PyQt4\QtGui.pyd', Binary was
not built with debug information.

It appears that PySide is loading the Qt Libraries from it's bin directory
whereas PyQt4 is loading the Libraries from the Maya bin directory.

Tony
Comment 6 Tony Barbieri 2011-09-14 17:59:25 EEST
Sorry I'm on Windows and ldd won't work with the pyd files in cygwin.  Only
.dll files.  I tried DependencyWalker and I got:

QtScript4.dll
QtSql4.dll
QtXmlPatterns4.dll
QtGui4.dll
QtNetwork4.dll
QtCore4.dll
MSVCR90.dll
Kernel32.dll
Comment 7 renato filho 2011-09-14 19:36:12 EEST
(In reply to comment #6)
> Sorry I'm on Windows and ldd won't work with the pyd files in cygwin.  Only
> .dll files.  I tried DependencyWalker and I got:
> 
> QtScript4.dll
> QtSql4.dll
> QtXmlPatterns4.dll
> QtGui4.dll
> QtNetwork4.dll
> QtCore4.dll
> MSVCR90.dll
> Kernel32.dll

This is relative to PySide or PyQt module? Could you provide the both PySide
and PyQt4 modules.
Comment 8 renato filho 2011-09-14 19:40:10 EEST
(In reply to comment #5)
> I attached Visual Studio to my Maya process to see if I could get any
> information and here is what I got.  Hopefully it helps:
> 
> When I try and import PySide.QtDeclarative
> 
> 'maya.exe': Loaded 'C:\Python26\Lib\site-packages\PySide\QtCore.pyd', Binary
> was not built with debug information.
> 'maya.exe': Loaded 'C:\Python26\Lib\site-packages\PySide\pyside-python2.6.dll',
> Binary was not built with debug information.
> 'maya.exe': Loaded
> 'C:\Python26\Lib\site-packages\PySide\shiboken-python2.6.dll', Binary was not
> built with debug information.
> 'maya.exe': Loaded 'C:\Python26\Lib\site-packages\PySide\QtDeclarative.pyd',
> Binary was not built with debug information.
> 'maya.exe': Loaded 'C:\Python26\Lib\site-packages\PySide\QtDeclarative4.dll',
> Binary was not built with debug information.
> 'maya.exe': Loaded 'C:\Python26\Lib\site-packages\PySide\QtScript4.dll', Binary
> was not built with debug information.
> 'maya.exe': Loaded 'C:\Python26\Lib\site-packages\PySide\QtSql4.dll', Binary
> was not built with debug information.
> 'maya.exe': Loaded 'C:\Python26\Lib\site-packages\PySide\QtXmlPatterns4.dll',
> Binary was not built with debug information.
> First-chance exception at 0x77a3d7d8 in maya.exe: 0xC0000139: Entry Point Not
> Found.
> 'maya.exe': Unloaded 'C:\Python26\Lib\site-packages\PySide\QtDeclarative.pyd'
> 'maya.exe': Unloaded 'C:\Python26\Lib\site-packages\PySide\QtDeclarative4.dll'
> 'maya.exe': Unloaded 'C:\Python26\Lib\site-packages\PySide\QtXmlPatterns4.dll'
> 'maya.exe': Unloaded 'C:\Python26\Lib\site-packages\PySide\QtSql4.dll'
> 'maya.exe': Unloaded 'C:\Python26\Lib\site-packages\PySide\QtScript4.dll'
> 
> When I load PyQt4.QtDeclarative
> 
> 'maya.exe': Loaded 'C:\Python26\Lib\site-packages\PyQt4\QtDeclarative.pyd',
> Binary was not built with debug information.
> 'maya.exe': Loaded 'C:\Program Files\Autodesk\Maya2012\bin\QtDeclarative4.dll'
> 'maya.exe': Loaded 'C:\Program Files\Autodesk\Maya2012\bin\QtScript4.dll'
> 'maya.exe': Loaded 'C:\Program Files\Autodesk\Maya2012\bin\QtSql4.dll'
> 'maya.exe': Loaded 'C:\Program Files\Autodesk\Maya2012\bin\QtXmlPatterns4.dll'
> 'maya.exe': Loaded 'C:\Python26\Lib\site-packages\sip.pyd', Binary was not
> built with debug information.
> 'maya.exe': Loaded 'C:\Python26\Lib\site-packages\PyQt4\QtCore.pyd', Binary was
> not built with debug information.
> 'maya.exe': Loaded 'C:\Python26\Lib\site-packages\PyQt4\QtNetwork.pyd', Binary
> was not built with debug information.
> 'maya.exe': Loaded 'C:\Python26\Lib\site-packages\PyQt4\QtGui.pyd', Binary was
> not built with debug information.
> 
> It appears that PySide is loading the Qt Libraries from it's bin directory
> whereas PyQt4 is loading the Libraries from the Maya bin directory.
> 
> Tony

Could you try move the Qt libraries from PySide directory, to verify if this
will work with maya qt?
Comment 9 Tony Barbieri 2011-09-14 19:49:03 EEST
PySide.QtDeclarative.pyd:


pyside-python26.dll
python26.dll
QtCore4.dll
QtGui4.dll
QtDeclarative4.dll
shiboken-python2.6.dll
MSVCR90.dll
Kernel32.dll

PyQt4.QtDeclarative.pyd:

Python26.dll
QtDeclarative4.dll
QtGui4.dll
QtCore4.dll
MSVCR90.dll
Kernel32.dll

After moving the dll files to site-packages/PySide/bin they now import properly
into Maya.  I believe this is forcing Maya to use the Qt libraries that are
within it's own bin folder.

in Visual Studio Maya is now reporting when I import PySide.QtDeclarative:

'maya.exe': Loaded 'C:\Python26\Lib\site-packages\PySide\QtCore.pyd', Binary
was not built with debug information.
'maya.exe': Loaded 'C:\Python26\Lib\site-packages\PySide\pyside-python2.6.dll',
Binary was not built with debug information.
'maya.exe': Loaded
'C:\Python26\Lib\site-packages\PySide\shiboken-python2.6.dll', Binary was not
built with debug information.
'maya.exe': Loaded 'C:\Python26\Lib\site-packages\PySide\QtDeclarative.pyd',
Binary was not built with debug information.
'maya.exe': Loaded 'C:\Program Files\Autodesk\Maya2012\bin\QtDeclarative4.dll'
'maya.exe': Loaded 'C:\Program Files\Autodesk\Maya2012\bin\QtScript4.dll'
'maya.exe': Loaded 'C:\Program Files\Autodesk\Maya2012\bin\QtSql4.dll'
'maya.exe': Loaded 'C:\Program Files\Autodesk\Maya2012\bin\QtXmlPatterns4.dll'
'maya.exe': Loaded 'C:\Python26\Lib\site-packages\PySide\QtNetwork.pyd', Binary
was not built with debug information.
'maya.exe': Loaded 'C:\Python26\Lib\site-packages\PySide\QtGui.pyd', Binary was
not built with debug information.

I don't know if this solves the problem or is just a bad workaround.  It seems
that within a python interactive session PySide still works as well.
Comment 10 Tony Barbieri 2011-09-14 20:03:23 EEST
Moving all .dll and .exe files into site-packages/PySide/bin and adding to the
system PATH variable: C:/Python26/Lib/site-packages/PySide/bin solves this
issue.  The only files remaining in the PySide root are all of the python
related files.  *.py, *.pyd, *.pyo.

An interactive python shell is also still able to import PySide.
Comment 11 renato filho 2011-09-14 23:45:57 EEST
Ok.
Then we can conclude this is only a compatibility problem, between the maya and
PySide Qt version.

If you confirm that I will close this bug.

Thanks
Comment 12 Tony Barbieri 2011-09-14 23:58:39 EEST
I can confirm that.  Would it be possible to change the directory structure of
the release for Windows to mimic more the way PyQt4 is structured?  It would
also require the PySide bin path to be added to the system PATH.  It isn't hard
to do it per release manually, but many more people may run into this issue
trying to use PySide with Maya and potentially other applications.  Both Maya
and the PySide  I compiled are both against Qt 4.7.1.  So technically they are
the same Qt version.  Autodesk even provided the Qt distribution they compiled
Maya against.

Thanks again for your help.
Comment 13 renato filho 2011-09-15 16:54:31 EEST
I will add Roman Lacko to this discussion, he is responsible for windows
packages. I think he is the right guy to talk about that.
Comment 14 Roman Lacko 2011-09-16 13:02:32 EEST
Hi,
i have installed latest PyQt4 and the directory structure is same as strucure
of PySide.
PyQt binaries are here C:\Python27\Lib\site-packages\PyQt4 (not in bin
subdirectory).

Here are differences:

1. PyQt installer puts path C:\Python27\Lib\site-packages\PyQt4 in PATH
environ. variable. I can change the PySide 
installer so it updates the PATH env. var.

2. Another differnce is in c:\Python27\qt.conf file.
Here is PyQt's:
[Paths]
Prefix = C:/Python27/Lib/site-packages/PyQt4
Binaries = C:/Python27/Lib/site-packages/PyQt4

Here is PySide's
[Paths]
Prefix = C:/Python27/Lib/site-packages/PySide
Binaries = .

the differece is that in PySide, the Binaries is set to relative path, not full
path.

Please can you check if the following is working ?
1. Reinstall PySide
2. Set path to C:/Python27/Lib/site-packages/PySide in PATH env. var.
3. Change c:\Python27\qt.conf:
  from this:
    Binaries = .
  to this:
    Binaries = C:/Python27/Lib/site-packages/PySide
4. Try to import PySide in maya.

Regards
-Roman