[PyQt] ImportError: cannot import name QtCore

rfc469 at gmail.com
Mon Mar 2 03:58:25 GMT 2015


I'm trying to install the latest sip (4.16.6) and the latest PyQt5 (5.4.1)
with the latest official Qt release (5.4.1). This is on a mac running
Yosemite 10.10.2. Everything seems to install and compile normally, but I
can't import any modules:

Python 3.3.3 (default, Feb 14 2015, 12:23:25)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt5
>>> from PyQt5 import QtCore
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name QtCore

The modules were installed as .so files under here:
/opt/gentoo/lib/python3.3/site-packages/PyQt5

The Qt installer was qt-opensource-mac-x64-clang-5.4.1.dmg and is installed
here:
/usr/local/qt-5.4.1

To configure PyQt5, I basically used the following (installed for both
python 3.3.3 and 2.7.8):
configure.py
--qmake="/usr/local/qt-5.4.1/5.4/clang_64/bin/qmake"
--no-designer-plugin
--no-qml-plugin
--destdir="/opt/gentoo/lib/python3.3/site-packages"
--no-timestamp
--no-qsci-api
--no-sip-files

Both the Qt files and PyQt appear to be correct for my architecture.
$ file QtCore.so
QtCore.so: Mach-O 64-bit x86_64 dynamically linked shared library

And it appears the PyQt5 .so is pointing to the Qt .dylib:
$ otool -L QtCore.so
QtCore.so:
/opt/gentoo/usr/lib/python3.3/site-packages/PyQt5/QtCore.so (compatibility
version 0.0.0, current version 0.0.0)
/usr/local/qt-5.4.1/5.4/clang_64/lib/QtCore.framework/Versions/5/QtCore
(compatibility version 5.4.0, current version 5.4.1)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version
104.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
1213.0.0)

Tried setting LD_LIBRARY_PATH to various paths, no difference.

Am I missing anything obvious?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150301/3686ee0f/attachment.html>


More information about the PyQt mailing list