[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: ImportError: cannot import name 'QtChart' from 'PyQt5' / Qprinter crashes
From:       Hans =?UTF-8?Q?J=C3=B6rg?= Maurer <hjm () pmeonline ! net>
Date:       2020-07-23 20:58:18
Message-ID: 0d8a907213e5b556144748d2a4962351 () pmeoffice ! de
[Download RAW message or body]

Dear Florian,


Part 1 (module not found) I could solve by changing the Python
Interpreter in 

Pycharm: '
File->Settings->Prioject Interpreter-> to C:\Program
Files\Python37\python.exe (Same as before, but other path)


Seems to be a virtual environment hassle.



Part 2: 



Aarghhh, you are right. In that testing module I forgot the
QApplication... I've got it just a minute before your mail.



Thanks a lot for your attention
Hans


I have to shut down earlier ;-)





Am Donnerstag, den 23.07.2020 um 22:40 schrieb Florian Bruhin:


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@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/

[Attachment #3 (text/html)]

<html>
<head>
<style type="text/css">
body,p,td,div,span{
	font-size:14px;font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, \
Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI \
Symbol"; };
body p{
	margin:0px;
}
</style>
</head>
<body><div>Dear Florian,</div><div><br></div><div><div>Part 1 (module not found) I \
could solve by changing the Python Interpreter in <br></div><div>Pycharm: \
'<br>File-&gt;Settings-&gt;Prioject Interpreter-&gt; to C:\Program \
Files\Python37\python.exe (Same as before, but other \
path)</div><div><br></div><div>Seems to be a virtual environment \
hassle.<br></div><div><br></div>Part 2: <br></div><div><br></div><div>Aarghhh, you \
are right. In that testing module I forgot the QApplication... I've got it just a \
minute before your mail.<br></div><div><br></div><div>Thanks a lot for your \
attention</div><div>Hans</div><div><br></div><div>I have to shut down earlier \
;-)<br></div><div><br></div><div><br></div>Am Donnerstag, den 23.07.2020 um 22:40 \
schrieb Florian Bruhin:<br><blockquote style="border:0;border-left: 2px solid \
#22437f; padding:0px; margin:0px; padding-left:5px; margin-left: 5px; ">On Thu, Jul \
23, 2020 at 07:46:05PM +0200, hjm wrote:<br> &gt; I've tested a script to use \
QPrinter and this ended up with Process finished<br> &gt; with exit code -1073740791 \
(0xC0000409) unable to debug (for me).<br> &gt; <br>
&gt; from PyQt5import QtPrintSupport<br>
&gt; myprinter= QtPrintSupport.QPrinter ()<br>
<br>
You most likely need to create a QApplication before using QPrinter.<br>
<br>
&gt; After that I got an import error also frpm another script which contains<br>
&gt; <br>
&gt; from PyQt5import QtChart<br>
&gt; <br>
&gt; ImportError: cannot import name 'QtChart' from 'PyQt5'<br>
&gt; (C:\Users\myname\IR-Check_Tablet\lib\site-packages\PyQt5\__init__.py).<br>
&gt; <br>
&gt; The files are installed, I have a directory with lot of files (53) called<br>
&gt; c:\Program Files\Python37\Lib\site-packages\PyQt5\bindings\QtChart\<br>
<br>
Those paths are different. It looks like you have two PyQt5 installs now, one<br>
in C:\Users\myname\IR-Check_Tablet\ (without QtChart) and one in c:\Program<br>
Files\Python37 (with QtChart). According to the ImportError, you're using the<br>
former.<br>
<br>
Florian<br>
<br>
-- <br>
<a class="normal-link" href="mailto:me@the-compiler.org">me@the-compiler.org</a> \
(Mail/XMPP) | <a href="https://www.qutebrowser.org" target="_blank" \
class="normal-link">https://www.qutebrowser.org</a> <br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://bruhin.software" \
target="_blank" class="normal-link">https://bruhin.software</a>/ | <a \
href="https://github.com/sponsors/The-Compiler" target="_blank" \
class="normal-link">https://github.com/sponsors/The-Compiler</a>/<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GPG: 916E B0C8 FD55 A072 | <a \
href="https://the-compiler.org/pubkey.asc" target="_blank" \
class="normal-link">https://the-compiler.org/pubkey.asc</a><br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I love long \
mails! | <a href="https://email.is-not-s.ms" target="_blank" \
class="normal-link">https://email.is-not-s.ms</a>/</blockquote></body></html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic