ModuleNotFoundError: No module named 'PyQt5.QtWidgets'

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
_Nemo
Posts: 117
Joined: Sat Feb 06, 2021 8:25 am

ModuleNotFoundError: No module named 'PyQt5.QtWidgets'

Post by _Nemo »

Hi all, I have a strange problem: when I type from PyQt5.QtWidgets import QWidget in the python console of FreeCAD 0.19.4 I get an error:

Code: Select all

ModuleNotFoundError: No module named 'PyQt5.QtWidgets', but in QtWidgets'
But the import is successful in the FreeCAD 0.19.4 path using the terminal, what is the reason for this?
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: ModuleNotFoundError: No module named 'PyQt5.QtWidgets'

Post by Syres »

Are you using self compiled or an AppImage? I thought the standard on 0.19.x was:

Code: Select all

from PySide2.QtWidgets import QWidget 
_Nemo
Posts: 117
Joined: Sat Feb 06, 2021 8:25 am

Re: ModuleNotFoundError: No module named 'PyQt5.QtWidgets'

Post by _Nemo »

Syres wrote: Tue May 23, 2023 10:32 am Are you using self compiled or an AppImage? I thought the standard on 0.19.x was:

Code: Select all

from PySide2.QtWidgets import QWidget 
Thank you for your reply! The function I need to realize is not supported by pyside, so I used pyqt.
Does FreeCAD 0.19 not support pyqt?
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: ModuleNotFoundError: No module named 'PyQt5.QtWidgets'

Post by Syres »

_Nemo wrote: Tue May 23, 2023 10:45 am Does FreeCAD 0.19 not support pyqt?
Support is a big word, to be honest I'm not sure.
Post Reply