ImportError: cannot import name 'QtChart' from 'PyQt5' / Qprinter crashes

Florian Bruhin me at the-compiler.org
Thu Jul 23 21:40:31 BST 2020


On Thu, Jul 23, 2020 at 07:46:05PM +0200, hjm wrote:
> I've tested a script to use QPrinter and this ended up with Process finished
> with exit code -1073740791 (0xC0000409) unable to debug (for me).
> 
> from PyQt5import QtPrintSupport
> myprinter= QtPrintSupport.QPrinter ()

You most likely need to create a QApplication before using QPrinter.

> After that I got an import error also frpm another script which contains
> 
> from PyQt5import QtChart
> 
> ImportError: cannot import name 'QtChart' from 'PyQt5'
> (C:\Users\myname\IR-Check_Tablet\lib\site-packages\PyQt5\__init__.py).
> 
> The files are installed, I have a directory with lot of files (53) called
> c:\Program Files\Python37\Lib\site-packages\PyQt5\bindings\QtChart\

Those paths are different. It looks like you have two PyQt5 installs now, one
in C:\Users\myname\IR-Check_Tablet\ (without QtChart) and one in c:\Program
Files\Python37 (with QtChart). According to the ImportError, you're using the
former.

Florian

-- 
me at the-compiler.org (Mail/XMPP) | https://www.qutebrowser.org 
       https://bruhin.software/ | https://github.com/sponsors/The-Compiler/
       GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc
             I love long mails! | https://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20200723/3745c2c2/attachment.sig>


More information about the PyQt mailing list