[python-win32] Windows scripting can't find _ctypes

Bob Kline bkline at rksystems.com
Mon Dec 19 09:40:29 EST 2022


I just ran into a snag after upgrading to Python 3.11.1. Running
Python 3.10.1 the ctypes module imports with no problems. Same under
Windows scripting using the pywin32 package. With 3.11.1 importing
ctypes directly still works. However, under Windows scripting using
the pywin32 package "import ctypes" fails with the following error
output:

IActiveScriptError QI - unknown IID {B21FB2A1-5B8F-4963-8C21-21450F84ED7F}
E:\tmp\test2.pys(12, 0) Python ActiveX Scripting Engine: Traceback
(most recent call last):
  File "<Script Block >", line 12, in <module>
    import ctypes
  File "e:\Python\Lib\ctypes\__init__.py", line 8, in <module>
    from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'

Anyone else stumbled onto this problem?

--
Bob Kline
https://www.rksystems.com
mailto:bkline at rksystems.com


More information about the python-win32 mailing list