enthought / comtypes

A pure Python, lightweight COM client and server framework, based on the ctypes Python FFI package.
Other
282 stars 96 forks source link

getting Syntax Error : Invalid Syntax with python 3.10.10 #517

Closed dineshu07 closed 4 months ago

dineshu07 commented 4 months ago

Hi

I'm trying to use pywinauto, following error comes right after the import statement. Please help me to resolve this. This is happening only on windows 10 machine.

Screenshot from 2024-02-22 17-59-15

junkmd commented 4 months ago

Hi,

This is likely due to a Python crash occurring during the comtypes process of writing code to the .py files in .../comtypes/gen/... (See also https://github.com/enthought/comtypes/issues/114).

I suggest running py -m comtypes.clear_cache (See also https://github.com/enthought/comtypes/pull/478 and CONTRIBUTING.md). This command will delete those partial wrapper files. Afterward, please call pywinauto again; it will regenerate the .py files.

Please let us know the results after trying the above steps.

dineshu07 commented 4 months ago

Hi @junkmd It worked!. Thank you so much for your quick solution.