getting PySide to work

302 views
Skip to first unread message

mike

unread,
May 17, 2011, 2:22:03 AM5/17/11
to PyInstaller
Hi all,

The following patch (everything between the starred lines) is how I
got PySide working with PyInstaller on my Mac. My version of PySide
is the binary distribution from the PySide website. What I see is
that the PySide developers install the libraries into /usr/lib, which
is excluded by default by PyInstaller. I agree that /usr/lib on the
Mac is probably/usually not installed into by 3rd party libraries, it
does so happen on occasion. In this case, I don't know what the best
solution is (which may include asking PySide to change their install
location). In any case, just wanted to share the results of my
findings.

******************************************
Index: PyInstaller/bindepend.py
===================================================================
--- PyInstaller/bindepend.py (revision 1406)
+++ PyInstaller/bindepend.py (working copy)
@@ -411,7 +411,11 @@
candidatelib = npth
else:
candidatelib = lib
- if (excludesRe.search(candidatelib) and (not includes or
+
+ if candidatelib.find('pyside') >= 0 or
candidatelib.find('shiboken') >= 0:
+ # do nothing
+ pass
+ elif (excludesRe.search(candidatelib) and (not includes or
not includesRe.search(candidatelib))):
if candidatelib.find('libpython') < 0 and \
candidatelib.find('Python.framework') < 0:
@@ -462,7 +466,7 @@
This implementation is for otool platforms"""
# dyld searches these paths for framework libs
# we ignore DYLD_FALLBACK_LIBRARY_PATH for now (man dyld)
- fwpaths = ['/Library/Frameworks', '/Network/Library/Frameworks',
'/System/Library/Frameworks']
+ fwpaths = ['/Library/Frameworks', '/Network/Library/Frameworks',
'/System/Library/Frameworks', '/usr/lib']
for p in reversed(os.environ.get('DYLD_FRAMEWORK_PATH',
'').split(':')):
if p:
fwpaths.insert(0, p)
******************************************

Hartmut Goebel

unread,
May 17, 2011, 5:11:36 AM5/17/11
to pyins...@googlegroups.com
Am 17.05.2011 08:22, schrieb mike: candidatelib = lib

> - if (excludesRe.search(candidatelib) and (not includes or
> +
> + if candidatelib.find('pyside')>= 0 or
> candidatelib.find('shiboken')>= 0:
> + # do nothing
> + pass
> + elif (excludesRe.search(candidatelib) and (not includes or
> not includesRe.search(candidatelib))):
> if candidatelib.find('libpython')< 0 and \
> candidatelib.find('Python.framework')< 0:
I do not like this "hack" for a single module/package. Isn't there
another solution?

--
Schönen Gruß - Regards
Hartmut Goebel
Dipl.-Informatiker (univ.), CISSP, CSSLP

Goebel Consult
Spezialist für IT-Sicherheit in komplexen Umgebungen
http://www.goebel-consult.de/blog

Monatliche Kolumne: http://www.cissp-gefluester.de/
Goebel Consult mit Mitglied bei http://www.7-it.de


mike

unread,
May 17, 2011, 5:31:18 AM5/17/11
to PyInstaller

> I do not like this "hack" for a single module/package. Isn't there
> another solution?

I agree that this hack is not desirable.

I simply thought to put it out there, as a topic of discussion, as
there are others waiting for PyInstaller to support PySide on Mac, but
to do so, we would need to change some assumptions that PyInstaller is
making about directories to include/exclude. The good news is, unlike
PyQT, no hook files are necessary :)

Cheers
Mike
Reply all
Reply to author
Forward
0 new messages