[PyQt] ImportError: cannot import name QtCore
•
rfc469 at gmail.com
Mon Mar 2 05:51:33 GMT 2015
On Sun, Mar 1, 2015 at 9:24 PM, Florian Bruhin <me at the-compiler.org> wrote:
> * • <rfc469 at gmail.com> [2015-03-01 19:58:25 -0800]:
> > 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
>
> What python binary are you running? Does it have
> /opt/gentoo/lib/python3.3/site-packages/PyQt5 in its sys.path? You can
> check like this:
>
> import sys
> print(sys.path)
>
> FWIW, I always install PyQt via Homebrew on OS X which works great for
> me.
>
> Florian
>
>
It's installed for both python 3.3.3 and 2.7.8, and I get the same error
for both.
Yes, the sys.path includes site-packages:
/opt/gentoo/usr/lib/python3.3/site-packages
I tried adding the PyQt5 subdir and no change. But isn't site-packages only
for python files, not .so files? There are no python files under the PyQt5
subdir except the __init__.p[y,c,o] and __pycache__. The rest are .so
files, for example QtCore.so.
I've heard good things about Homebrew but have been using Gentoo for awhile.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150301/1156d151/attachment-0001.html>
More information about the PyQt
mailing list