[External] Re: Running PyQt6 with Debug Modules

Johnmichael.Quinlan at idsoftware.com Johnmichael.Quinlan at idsoftware.com
Fri Aug 26 15:04:58 BST 2022


Hi Florian,

Unfortunately that wasn't it, I was running python_d.exe and python.exe from the same location and running with the -v flag as you suggested indicated that they were both looking in the same place for the modules please see the images and output below, however, it should be easy for you to test, I'm on windows with a default vanilla Python 3.10 installation, I installed PyQt6 using pip into that installation, then simply run the code I posted originally in the python.exe and then in the python_d.exe for the same installation.

[cid:image001.png at 01D8B92A.B140D250]

python.exe ( release console ) output as text:

S:\python310>python.exe -v

import _frozen_importlib # frozen

import _imp # builtin

import '_thread' # <class '_frozen_importlib.BuiltinImporter'>

import '_warnings' # <class '_frozen_importlib.BuiltinImporter'>

import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>

import '_io' # <class '_frozen_importlib.BuiltinImporter'>

import 'marshal' # <class '_frozen_importlib.BuiltinImporter'>

import 'nt' # <class '_frozen_importlib.BuiltinImporter'>

import 'winreg' # <class '_frozen_importlib.BuiltinImporter'>

import '_frozen_importlib_external' # <class '_frozen_importlib.FrozenImporter'>

# installing zipimport hook

import 'time' # <class '_frozen_importlib.BuiltinImporter'>

import 'zipimport' # <class '_frozen_importlib.FrozenImporter'>

# installed zipimport hook

# S:\python310\lib\encodings\__pycache__\__init__.cpython-310.pyc matches S:\python310\lib\encodings\__init__.py

# code object from 'S:\\python310\\lib\\encodings\\__pycache__\\__init__.cpython-310.pyc'

# S:\python310\lib\__pycache__\codecs.cpython-310.pyc matches S:\python310\lib\codecs.py

# code object from 'S:\\python310\\lib\\__pycache__\\codecs.cpython-310.pyc'

import '_codecs' # <class '_frozen_importlib.BuiltinImporter'>

import 'codecs' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA29EEF0>

# S:\python310\lib\encodings\__pycache__\aliases.cpython-310.pyc matches S:\python310\lib\encodings\aliases.py

# code object from 'S:\\python310\\lib\\encodings\\__pycache__\\aliases.cpython-310.pyc'

import 'encodings.aliases' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA2F8490>

import 'encodings' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA29ED40>

# S:\python310\lib\encodings\__pycache__\utf_8.cpython-310.pyc matches S:\python310\lib\encodings\utf_8.py

# code object from 'S:\\python310\\lib\\encodings\\__pycache__\\utf_8.cpython-310.pyc'

import 'encodings.utf_8' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA29ECB0>

# S:\python310\lib\encodings\__pycache__\cp1252.cpython-310.pyc matches S:\python310\lib\encodings\cp1252.py

# code object from 'S:\\python310\\lib\\encodings\\__pycache__\\cp1252.cpython-310.pyc'

import 'encodings.cp1252' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA2F85E0>

import '_signal' # <class '_frozen_importlib.BuiltinImporter'>

# S:\python310\lib\__pycache__\io.cpython-310.pyc matches S:\python310\lib\io.py

# code object from 'S:\\python310\\lib\\__pycache__\\io.cpython-310.pyc'

# S:\python310\lib\__pycache__\abc.cpython-310.pyc matches S:\python310\lib\abc.py

# code object from 'S:\\python310\\lib\\__pycache__\\abc.cpython-310.pyc'

import '_abc' # <class '_frozen_importlib.BuiltinImporter'>

import 'abc' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA2F8AC0>

import 'io' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA2F8880>

# S:\python310\lib\__pycache__\site.cpython-310.pyc matches S:\python310\lib\site.py

# code object from 'S:\\python310\\lib\\__pycache__\\site.cpython-310.pyc'

# S:\python310\lib\__pycache__\os.cpython-310.pyc matches S:\python310\lib\os.py

# code object from 'S:\\python310\\lib\\__pycache__\\os.cpython-310.pyc'

# S:\python310\lib\__pycache__\stat.cpython-310.pyc matches S:\python310\lib\stat.py

# code object from 'S:\\python310\\lib\\__pycache__\\stat.cpython-310.pyc'

import '_stat' # <class '_frozen_importlib.BuiltinImporter'>

import 'stat' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA2FAD40>

# S:\python310\lib\__pycache__\_collections_abc.cpython-310.pyc matches S:\python310\lib\_collections_abc.py

# code object from 'S:\\python310\\lib\\__pycache__\\_collections_abc.cpython-310.pyc'

import '_collections_abc' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA2FB070>

# S:\python310\lib\__pycache__\ntpath.cpython-310.pyc matches S:\python310\lib\ntpath.py

# code object from 'S:\\python310\\lib\\__pycache__\\ntpath.cpython-310.pyc'

# S:\python310\lib\__pycache__\genericpath.cpython-310.pyc matches S:\python310\lib\genericpath.py

# code object from 'S:\\python310\\lib\\__pycache__\\genericpath.cpython-310.pyc'

import 'genericpath' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA33DAB0>

import '_winapi' # <class '_frozen_importlib.BuiltinImporter'>

import 'ntpath' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA2FB220>

import 'os' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA2F9960>

# S:\python310\lib\__pycache__\_sitebuiltins.cpython-310.pyc matches S:\python310\lib\_sitebuiltins.py

# code object from 'S:\\python310\\lib\\__pycache__\\_sitebuiltins.cpython-310.pyc'

import '_sitebuiltins' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA2FA9B0>

Processing user site-packages

Processing global site-packages

Adding directory: 'S:\\python310'

Adding directory: 'S:\\python310\\lib\\site-packages'

Processing .pth file: 'S:\\python310\\lib\\site-packages\\distutils-precedence.pth'

# code object from S:\python310\lib\site-packages\_distutils_hack\__init__.py

# could not create 'S:\\python310\\lib\\site-packages\\_distutils_hack\\__pycache__\\__init__.cpython-310.pyc': PermissionError(13, 'Access is denied')

import '_distutils_hack' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA33EB60>

import 'site' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA2F92D0>

Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] on win32

Type "help", "copyright", "credits" or "license" for more information.

import 'atexit' # <class '_frozen_importlib.BuiltinImporter'>

>>>

then importing PyQt6 and QtWidgets:

>>> import PyQt6

# S:\python310\lib\site-packages\PyQt6\__pycache__\__init__.cpython-310.pyc matches S:\python310\lib\site-packages\PyQt6\__init__.py

# code object from 'S:\\python310\\lib\\site-packages\\PyQt6\\__pycache__\\__init__.cpython-310.pyc'

# S:\python310\lib\__pycache__\pkgutil.cpython-310.pyc matches S:\python310\lib\pkgutil.py

# code object from 'S:\\python310\\lib\\__pycache__\\pkgutil.cpython-310.pyc'

# S:\python310\lib\collections\__pycache__\__init__.cpython-310.pyc matches S:\python310\lib\collections\__init__.py

# code object from 'S:\\python310\\lib\\collections\\__pycache__\\__init__.cpython-310.pyc'

import 'itertools' # <class '_frozen_importlib.BuiltinImporter'>

# S:\python310\lib\__pycache__\keyword.cpython-310.pyc matches S:\python310\lib\keyword.py

# code object from 'S:\\python310\\lib\\__pycache__\\keyword.cpython-310.pyc'

import 'keyword' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA38CD60>

# S:\python310\lib\__pycache__\operator.cpython-310.pyc matches S:\python310\lib\operator.py

# code object from 'S:\\python310\\lib\\__pycache__\\operator.cpython-310.pyc'

import '_operator' # <class '_frozen_importlib.BuiltinImporter'>

import 'operator' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA38CCD0>

# S:\python310\lib\__pycache__\reprlib.cpython-310.pyc matches S:\python310\lib\reprlib.py

# code object from 'S:\\python310\\lib\\__pycache__\\reprlib.cpython-310.pyc'

import 'reprlib' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA38CAC0>

import '_collections' # <class '_frozen_importlib.BuiltinImporter'>

import 'collections' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA38F5B0>

# S:\python310\lib\__pycache__\functools.cpython-310.pyc matches S:\python310\lib\functools.py

# code object from 'S:\\python310\\lib\\__pycache__\\functools.cpython-310.pyc'

# S:\python310\lib\__pycache__\types.cpython-310.pyc matches S:\python310\lib\types.py

# code object from 'S:\\python310\\lib\\__pycache__\\types.cpython-310.pyc'

import 'types' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA388F10>

import '_functools' # <class '_frozen_importlib.BuiltinImporter'>

import 'functools' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA38C2B0>

# S:\python310\lib\importlib\__pycache__\__init__.cpython-310.pyc matches S:\python310\lib\importlib\__init__.py

# code object from 'S:\\python310\\lib\\importlib\\__pycache__\\__init__.cpython-310.pyc'

# S:\python310\lib\__pycache__\warnings.cpython-310.pyc matches S:\python310\lib\warnings.py

# code object from 'S:\\python310\\lib\\__pycache__\\warnings.cpython-310.pyc'

import 'warnings' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA38FB50>

import 'importlib' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA3882E0>

# S:\python310\lib\importlib\__pycache__\util.cpython-310.pyc matches S:\python310\lib\importlib\util.py

# code object from 'S:\\python310\\lib\\importlib\\__pycache__\\util.cpython-310.pyc'

# S:\python310\lib\importlib\__pycache__\_abc.cpython-310.pyc matches S:\python310\lib\importlib\_abc.py

# code object from 'S:\\python310\\lib\\importlib\\__pycache__\\_abc.cpython-310.pyc'

import 'importlib._abc' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA38B460>

# S:\python310\lib\__pycache__\contextlib.cpython-310.pyc matches S:\python310\lib\contextlib.py

# code object from 'S:\\python310\\lib\\__pycache__\\contextlib.cpython-310.pyc'

import 'contextlib' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA38AEC0>

import 'importlib.util' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA38D390>

# S:\python310\lib\importlib\__pycache__\machinery.cpython-310.pyc matches S:\python310\lib\importlib\machinery.py

# code object from 'S:\\python310\\lib\\importlib\\__pycache__\\machinery.cpython-310.pyc'

import 'importlib.machinery' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA38A650>

# S:\python310\lib\__pycache__\weakref.cpython-310.pyc matches S:\python310\lib\weakref.py

# code object from 'S:\\python310\\lib\\__pycache__\\weakref.cpython-310.pyc'

# S:\python310\lib\__pycache__\_weakrefset.cpython-310.pyc matches S:\python310\lib\_weakrefset.py

# code object from 'S:\\python310\\lib\\__pycache__\\_weakrefset.cpython-310.pyc'

import '_weakrefset' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA384A90>

import 'weakref' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA3895D0>

import 'pkgutil' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA38F280>

import 'PyQt6' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA33EDD0>

>>> from PyQt6 import QtWidgets

# S:\python310\lib\__pycache__\enum.cpython-310.pyc matches S:\python310\lib\enum.py

# code object from 'S:\\python310\\lib\\__pycache__\\enum.cpython-310.pyc'

import 'enum' # <_frozen_importlib_external.SourceFileLoader object at 0x000001D2DA387430>

# extension module 'PyQt6.sip' loaded from 'S:\\python310\\lib\\site-packages\\PyQt6\\sip.cp310-win_amd64.pyd'

# extension module 'PyQt6.sip' executed from 'S:\\python310\\lib\\site-packages\\PyQt6\\sip.cp310-win_amd64.pyd'

import 'PyQt6.sip' # <_frozen_importlib_external.ExtensionFileLoader object at 0x000001D2DA387580>

# extension module 'PyQt6.QtCore' loaded from 'S:\\python310\\lib\\site-packages\\PyQt6\\QtCore.pyd'

# extension module 'PyQt6.QtCore' executed from 'S:\\python310\\lib\\site-packages\\PyQt6\\QtCore.pyd'

import 'PyQt6.QtCore' # <_frozen_importlib_external.ExtensionFileLoader object at 0x000001D2DA385E70>

# extension module 'PyQt6.QtGui' loaded from 'S:\\python310\\lib\\site-packages\\PyQt6\\QtGui.pyd'

# extension module 'PyQt6.QtGui' executed from 'S:\\python310\\lib\\site-packages\\PyQt6\\QtGui.pyd'

import 'PyQt6.QtGui' # <_frozen_importlib_external.ExtensionFileLoader object at 0x000001D2DA37B1F0>

# extension module 'PyQt6.QtWidgets' loaded from 'S:\\python310\\lib\\site-packages\\PyQt6\\QtWidgets.pyd'

# extension module 'PyQt6.QtWidgets' executed from 'S:\\python310\\lib\\site-packages\\PyQt6\\QtWidgets.pyd'

import 'PyQt6.QtWidgets' # <_frozen_importlib_external.ExtensionFileLoader object at 0x000001D2DA387730>

>>>



Now with the python_d.exe ( debug console ) :



S:\python310>python_d.exe -v

import _frozen_importlib # frozen

import _imp # builtin

import '_thread' # <class '_frozen_importlib.BuiltinImporter'>

import '_warnings' # <class '_frozen_importlib.BuiltinImporter'>

import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>

import '_io' # <class '_frozen_importlib.BuiltinImporter'>

import 'marshal' # <class '_frozen_importlib.BuiltinImporter'>

import 'nt' # <class '_frozen_importlib.BuiltinImporter'>

import 'winreg' # <class '_frozen_importlib.BuiltinImporter'>

import '_frozen_importlib_external' # <class '_frozen_importlib.FrozenImporter'>

# installing zipimport hook

import 'time' # <class '_frozen_importlib.BuiltinImporter'>

import 'zipimport' # <class '_frozen_importlib.FrozenImporter'>

# installed zipimport hook

# S:\python310\lib\encodings\__pycache__\__init__.cpython-310.pyc matches S:\python310\lib\encodings\__init__.py

# code object from 'S:\\python310\\lib\\encodings\\__pycache__\\__init__.cpython-310.pyc'

# S:\python310\lib\__pycache__\codecs.cpython-310.pyc matches S:\python310\lib\codecs.py

# code object from 'S:\\python310\\lib\\__pycache__\\codecs.cpython-310.pyc'

import '_codecs' # <class '_frozen_importlib.BuiltinImporter'>

import 'codecs' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCAC66940>

# S:\python310\lib\encodings\__pycache__\aliases.cpython-310.pyc matches S:\python310\lib\encodings\aliases.py

# code object from 'S:\\python310\\lib\\encodings\\__pycache__\\aliases.cpython-310.pyc'

import 'encodings.aliases' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCAC7FCA0>

import 'encodings' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCAC659F0>

# S:\python310\lib\encodings\__pycache__\utf_8.cpython-310.pyc matches S:\python310\lib\encodings\utf_8.py

# code object from 'S:\\python310\\lib\\encodings\\__pycache__\\utf_8.cpython-310.pyc'

import 'encodings.utf_8' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCAC9BFC0>

# S:\python310\lib\encodings\__pycache__\cp1252.cpython-310.pyc matches S:\python310\lib\encodings\cp1252.py

# code object from 'S:\\python310\\lib\\encodings\\__pycache__\\cp1252.cpython-310.pyc'

import 'encodings.cp1252' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCACA4690>

import '_signal' # <class '_frozen_importlib.BuiltinImporter'>

# S:\python310\lib\__pycache__\io.cpython-310.pyc matches S:\python310\lib\io.py

# code object from 'S:\\python310\\lib\\__pycache__\\io.cpython-310.pyc'

# S:\python310\lib\__pycache__\abc.cpython-310.pyc matches S:\python310\lib\abc.py

# code object from 'S:\\python310\\lib\\__pycache__\\abc.cpython-310.pyc'

import '_abc' # <class '_frozen_importlib.BuiltinImporter'>

import 'abc' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCACA5450>

import 'io' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCACA4E10>

# S:\python310\lib\__pycache__\site.cpython-310.pyc matches S:\python310\lib\site.py

# code object from 'S:\\python310\\lib\\__pycache__\\site.cpython-310.pyc'

# S:\python310\lib\__pycache__\os.cpython-310.pyc matches S:\python310\lib\os.py

# code object from 'S:\\python310\\lib\\__pycache__\\os.cpython-310.pyc'

# S:\python310\lib\__pycache__\stat.cpython-310.pyc matches S:\python310\lib\stat.py

# code object from 'S:\\python310\\lib\\__pycache__\\stat.cpython-310.pyc'

import '_stat' # <class '_frozen_importlib.BuiltinImporter'>

import 'stat' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCACCCBE0>

# S:\python310\lib\__pycache__\_collections_abc.cpython-310.pyc matches S:\python310\lib\_collections_abc.py

# code object from 'S:\\python310\\lib\\__pycache__\\_collections_abc.cpython-310.pyc'

import '_collections_abc' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCACCEAD0>

# S:\python310\lib\__pycache__\ntpath.cpython-310.pyc matches S:\python310\lib\ntpath.py

# code object from 'S:\\python310\\lib\\__pycache__\\ntpath.cpython-310.pyc'

# S:\python310\lib\__pycache__\genericpath.cpython-310.pyc matches S:\python310\lib\genericpath.py

# code object from 'S:\\python310\\lib\\__pycache__\\genericpath.cpython-310.pyc'

import 'genericpath' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCACF9360>

import '_winapi' # <class '_frozen_importlib.BuiltinImporter'>

import 'ntpath' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCACCEF30>

import 'os' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCACBCA00>

# S:\python310\lib\__pycache__\_sitebuiltins.cpython-310.pyc matches S:\python310\lib\_sitebuiltins.py

# code object from 'S:\\python310\\lib\\__pycache__\\_sitebuiltins.cpython-310.pyc'

import '_sitebuiltins' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCACBF980>

Processing user site-packages

Processing global site-packages

Adding directory: 'S:\\python310'

Adding directory: 'S:\\python310\\lib\\site-packages'

Processing .pth file: 'S:\\python310\\lib\\site-packages\\distutils-precedence.pth'

# code object from S:\python310\lib\site-packages\_distutils_hack\__init__.py

# could not create 'S:\\python310\\lib\\site-packages\\_distutils_hack\\__pycache__\\__init__.cpython-310.pyc': PermissionError(13, 'Access is denied')

import '_distutils_hack' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCACFAE90>

import 'site' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCACA6710>

Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:38:53) [MSC v.1932 64 bit (AMD64)] on win32

Type "help", "copyright", "credits" or "license" for more information.

import 'atexit' # <class '_frozen_importlib.BuiltinImporter'>

>>>


Notice the paths are the same, now to import PyQt6 and QtWidgets

>>> import PyQt6

# S:\python310\lib\site-packages\PyQt6\__pycache__\__init__.cpython-310.pyc matches S:\python310\lib\site-packages\PyQt6\__init__.py

# code object from 'S:\\python310\\lib\\site-packages\\PyQt6\\__pycache__\\__init__.cpython-310.pyc'

# S:\python310\lib\__pycache__\pkgutil.cpython-310.pyc matches S:\python310\lib\pkgutil.py

# code object from 'S:\\python310\\lib\\__pycache__\\pkgutil.cpython-310.pyc'

# S:\python310\lib\collections\__pycache__\__init__.cpython-310.pyc matches S:\python310\lib\collections\__init__.py

# code object from 'S:\\python310\\lib\\collections\\__pycache__\\__init__.cpython-310.pyc'

import 'itertools' # <class '_frozen_importlib.BuiltinImporter'>

# S:\python310\lib\__pycache__\keyword.cpython-310.pyc matches S:\python310\lib\keyword.py

# code object from 'S:\\python310\\lib\\__pycache__\\keyword.cpython-310.pyc'

import 'keyword' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCB07C050>

# S:\python310\lib\__pycache__\operator.cpython-310.pyc matches S:\python310\lib\operator.py

# code object from 'S:\\python310\\lib\\__pycache__\\operator.cpython-310.pyc'

import '_operator' # <class '_frozen_importlib.BuiltinImporter'>

import 'operator' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCB0737A0>

# S:\python310\lib\__pycache__\reprlib.cpython-310.pyc matches S:\python310\lib\reprlib.py

# code object from 'S:\\python310\\lib\\__pycache__\\reprlib.cpython-310.pyc'

import 'reprlib' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCB0728A0>

import '_collections' # <class '_frozen_importlib.BuiltinImporter'>

import 'collections' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCB088C80>

# S:\python310\lib\__pycache__\functools.cpython-310.pyc matches S:\python310\lib\functools.py

# code object from 'S:\\python310\\lib\\__pycache__\\functools.cpython-310.pyc'

# S:\python310\lib\__pycache__\types.cpython-310.pyc matches S:\python310\lib\types.py

# code object from 'S:\\python310\\lib\\__pycache__\\types.cpython-310.pyc'

import 'types' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCB0FCAF0>

import '_functools' # <class '_frozen_importlib.BuiltinImporter'>

import 'functools' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCB089270>

# S:\python310\lib\importlib\__pycache__\__init__.cpython-310.pyc matches S:\python310\lib\importlib\__init__.py

# code object from 'S:\\python310\\lib\\importlib\\__pycache__\\__init__.cpython-310.pyc'

# S:\python310\lib\__pycache__\warnings.cpython-310.pyc matches S:\python310\lib\warnings.py

# code object from 'S:\\python310\\lib\\__pycache__\\warnings.cpython-310.pyc'

import 'warnings' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCB0DBE30>

import 'importlib' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCB07C5A0>

# S:\python310\lib\importlib\__pycache__\util.cpython-310.pyc matches S:\python310\lib\importlib\util.py

# code object from 'S:\\python310\\lib\\importlib\\__pycache__\\util.cpython-310.pyc'

# S:\python310\lib\importlib\__pycache__\_abc.cpython-310.pyc matches S:\python310\lib\importlib\_abc.py

# code object from 'S:\\python310\\lib\\importlib\\__pycache__\\_abc.cpython-310.pyc'

import 'importlib._abc' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCB0FFFC0>

# S:\python310\lib\__pycache__\contextlib.cpython-310.pyc matches S:\python310\lib\contextlib.py

# code object from 'S:\\python310\\lib\\__pycache__\\contextlib.cpython-310.pyc'

import 'contextlib' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCB110550>

import 'importlib.util' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCB0FE760>

# S:\python310\lib\importlib\__pycache__\machinery.cpython-310.pyc matches S:\python310\lib\importlib\machinery.py

# code object from 'S:\\python310\\lib\\importlib\\__pycache__\\machinery.cpython-310.pyc'

import 'importlib.machinery' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCB110910>

# S:\python310\lib\__pycache__\weakref.cpython-310.pyc matches S:\python310\lib\weakref.py

# code object from 'S:\\python310\\lib\\__pycache__\\weakref.cpython-310.pyc'

# S:\python310\lib\__pycache__\_weakrefset.cpython-310.pyc matches S:\python310\lib\_weakrefset.py

# code object from 'S:\\python310\\lib\\__pycache__\\_weakrefset.cpython-310.pyc'

import '_weakrefset' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCB13CD70>

import 'weakref' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCB1133E0>

import 'pkgutil' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCB093B60>

import 'PyQt6' # <_frozen_importlib_external.SourceFileLoader object at 0x0000020FCB0937F0>

>>> from PyQt6 import QtWidgets

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

ImportError: cannot import name 'QtWidgets' from 'PyQt6' (S:\python310\lib\site-packages\PyQt6\__init__.py)

>>>

As you can see it's not a difference in python installations...



Many thanks

Jm



-----Original Message-----
From: Florian Bruhin <me at the-compiler.org>
Sent: Friday, August 26, 2022 5:07 AM
To: Johnmichael Quinlan <Johnmichael.Quinlan at idsoftware.com>
Cc: pyqt at riverbankcomputing.com
Subject: [External] Re: Running PyQt6 with Debug Modules



Hey,



On Fri, Aug 26, 2022 at 04:24:08AM +0000, Johnmichael.Quinlan at idsoftware.com<mailto:Johnmichael.Quinlan at idsoftware.com> wrote:

> I have an application that I need to run in debug that utilizes PyQt6, however, the modules fail to load, it appears I need to build PyQt6 with debug symbols, likely against the Qt debug libraries? I couldn't find any documentation on how to do this and it doesn't appear to be supported in the shipped modules you can download. See the code and images below for details:

>

> [...]

>

> If anyone can help me figure out the steps I would need to build PyQt6 modules that work in debug that would be amazing.



As far as I know, you don't need to have a debug Qt/PyQt to use it with a debug Python. It looks like you simply have two separate installs of Python, and only have PyQt installed in one of them.



If you run your python_d.exe with the -v flag, it will show you where it's trying to find modules you are importing. If you compare those paths to the python.exe ones, that should give you an idea of what's missing.



> I tried to build pyqt6 with sipbuild from the debug console passing

> the debug flag however it cant find some modules for sipbuild, so the

> next thing I was going to try was building sipbuild in debug. It just

> seems like a bit of mine field without any documentation.



How to build PyQt6 from source is documented pretty well:

https://www.riverbankcomputing.com/static/Docs/PyQt6/installation.html#building-and-installing-from-source



Florian



--

            me at the-compiler.org<mailto:me at the-compiler.org> | 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 --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20220826/196a63f9/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 135352 bytes
Desc: image001.png
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20220826/196a63f9/attachment-0001.png>


More information about the PyQt mailing list