[PyQt] A little trouble developing a conda recipe for PyQt5

Darren Dale dsdale24 at gmail.com
Thu Aug 7 20:01:24 BST 2014


Hello,

I've been working on conda recipes for Qt5 and PyQt5. For the unfamiliar,
conda is similar to linux package managers, but can install packages into
an arbitrary environment on the target machine. For example I've been using
~/envs/qt5, which would be similar in scope to /usr/local. So the libraries
end up being relocated, and conda takes care of fixing the paths in
binaries and so forth.

I have successfully built and tested conda packages for the qt5/sip/pyqt5
stack for linux, and am now working on packages for OS X. I think my qt5
conda package for OS X was successful, at least I am able to run designer
and the output of `qmake -query` is correct. But when I try to configure
PyQt5, I run into problems loading the shared Qt5 libraries:

---
$ ~/anaconda/envs/qt5/bin/python configure.py -q
~/anaconda/envs/qt5/bin/qmake-qt5  --verbose
Querying qmake about your Qt installation...
Determining the details of your Qt installation...
/Users/darren/anaconda/envs/qt5/bin/qmake-qt5 -o qtdetail.mk qtdetail.pro
make -f qtdetail.mk
/Applications/Xcode.app/Contents/Developer/usr/bin/g++ -c -pipe -O2
-isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
-mmacosx-version-min=10.6 -Wall -W -fPIE -DQT_NO_DEBUG -DQT_CORE_LIB
-I../../anaconda/envs/qt5/lib/qt5/mkspecs/macx-g++ -I.
-I../../anaconda/envs/qt5/include/qt5
-I../../anaconda/envs/qt5/include/qt5/QtCore -I. -o qtdetail.o qtdetail.cpp
/Applications/Xcode.app/Contents/Developer/usr/bin/g++
-headerpad_max_install_names
-Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
-mmacosx-version-min=10.6 -o qtdetail.app/Contents/MacOS/qtdetail
qtdetail.o   -L/Users/darren/anaconda/envs/qt5/lib -lQt5Core
qtdetail.app/Contents/MacOS/qtdetail
dyld: Library not loaded: libQt5Core.5.dylib
  Referenced from:
/Users/darren/Downloads/PyQt-gpl-5.3.1/qtdetail.app/Contents/MacOS/qtdetail
  Reason: image not found
Error: qtdetail.app/Contents/MacOS/qtdetail failed to create qtdetail.out.
Make
sure your Qt installation is correct.
---

If I inspect qtdetail with `otool -L`, I find:

---
$ otool -L qtdetail.app/Contents/MacOS/qtdetail
qtdetail.app/Contents/MacOS/qtdetail:
libQt5Core.5.dylib (compatibility version 5.3.0, current version 5.3.1)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version
60.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
1197.1.1)
---

I suspect that the lack of a path before libQt5Core.5.dylib is relevant. In
contrast, inspecting designer with `otool -L`, I get:

---
$ otool -L
~/anaconda/envs/qt5/lib/qt5/bin/Designer.app/Contents/MacOS/Designer
/Users/darren/anaconda/envs/qt5/lib/qt5/bin/Designer.app/Contents/MacOS/Designer:
@loader_path/../../../../../libQt5DesignerComponents.5.dylib (compatibility
version 5.3.0, current version 5.3.1)
@loader_path/../../../../../libQt5PrintSupport.5.dylib (compatibility
version 5.3.0, current version 5.3.1)
@loader_path/../../../../../libQt5Designer.5.dylib (compatibility version
5.3.0, current version 5.3.1)
@loader_path/../../../../../libQt5Widgets.5.dylib (compatibility version
5.3.0, current version 5.3.1)
@loader_path/../../../../../libQt5Network.5.dylib (compatibility version
5.3.0, current version 5.3.1)
@loader_path/../../../../../libQt5Xml.5.dylib (compatibility version 5.3.0,
current version 5.3.1)
@loader_path/../../../../../libQt5Gui.5.dylib (compatibility version 5.3.0,
current version 5.3.1)
@loader_path/../../../../../libQt5Core.5.dylib (compatibility version
5.3.0, current version 5.3.1)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
(compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility
version 1.0.0, current version 1.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version
60.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
1197.1.1)
---

Does anyone have an idea why qtdetail would not include the path for
libQt5Core.5.dylib? Or if that is not relevant, why qtdetail is not finding
my shared libraries? Here is the output of qmake -query:

---
$ ~/anaconda/envs/qt5/bin/qmake-qt5  -query
QT_SYSROOT:
QT_INSTALL_PREFIX:/Users/darren/anaconda/envs/qt5
QT_INSTALL_ARCHDATA:/Users/darren/anaconda/envs/qt5/lib/qt5
QT_INSTALL_DATA:/Users/darren/anaconda/envs/qt5/share/qt5
QT_INSTALL_DOCS:/Users/darren/anaconda/envs/qt5/share/qt5/doc
QT_INSTALL_HEADERS:/Users/darren/anaconda/envs/qt5/include/qt5
QT_INSTALL_LIBS:/Users/darren/anaconda/envs/qt5/lib
QT_INSTALL_LIBEXECS:/Users/darren/anaconda/envs/qt5/lib/qt5/libexec
QT_INSTALL_BINS:/Users/darren/anaconda/envs/qt5/lib/qt5/bin
QT_INSTALL_TESTS:/Users/darren/anaconda/envs/qt5/tests
QT_INSTALL_PLUGINS:/Users/darren/anaconda/envs/qt5/lib/qt5/plugins
QT_INSTALL_IMPORTS:/Users/darren/anaconda/envs/qt5/lib/qt5/imports
QT_INSTALL_QML:/Users/darren/anaconda/envs/qt5/lib/qt5/qml
QT_INSTALL_TRANSLATIONS:/Users/darren/anaconda/envs/qt5/share/qt5/translations
QT_INSTALL_CONFIGURATION:/Library/Preferences/Qt
QT_INSTALL_EXAMPLES:/Users/darren/anaconda/envs/qt5/examples
QT_INSTALL_DEMOS:/Users/darren/anaconda/envs/qt5/examples
QT_HOST_PREFIX:/Users/darren/anaconda/envs/qt5
QT_HOST_DATA:/Users/darren/anaconda/envs/qt5/lib/qt5
QT_HOST_BINS:/Users/darren/anaconda/envs/qt5/lib/qt5/bin
QT_HOST_LIBS:/Users/darren/anaconda/envs/qt5/lib
QMAKE_SPEC:macx-g++
QMAKE_XSPEC:macx-g++
QMAKE_VERSION:3.0
QT_VERSION:5.3.1
---

And here is verification that libQt5Core.5.dylib can be found in
QT_INSTALL_LIBS:

---
$ ls -alh ~/anaconda/envs/qt5/lib/libQt5Core.*
-rwxr-xr-x  3 darren  staff   6.1M Aug  7 12:04
/Users/darren/anaconda/envs/qt5/lib/libQt5Core.5.3.1.dylib
lrwxr-xr-x  1 darren  staff    22B Aug  7 12:04
/Users/darren/anaconda/envs/qt5/lib/libQt5Core.5.3.dylib ->
libQt5Core.5.3.1.dylib
lrwxr-xr-x  1 darren  staff    22B Aug  7 12:04
/Users/darren/anaconda/envs/qt5/lib/libQt5Core.5.dylib ->
libQt5Core.5.3.1.dylib
lrwxr-xr-x  1 darren  staff    22B Aug  7 12:04
/Users/darren/anaconda/envs/qt5/lib/libQt5Core.dylib ->
libQt5Core.5.3.1.dylib
-rw-r--r--  1 darren  staff   680B Aug  7 12:04
/Users/darren/anaconda/envs/qt5/lib/libQt5Core.la
-rw-r--r--  3 darren  staff   1.1K Aug  7 11:52
/Users/darren/anaconda/envs/qt5/lib/libQt5Core.prl
---

Thanks, and sorry for the length.

Darren
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140807/ba84e812/attachment.html>


More information about the PyQt mailing list