1

I just updated my python from 3.7 to 3.10 and now there are import error's. While I just needed for import win32gui turn into import win32.win32gui as suggested here. There seems no other syntax for import win32ui, after some research I found this github report that has been closed with:

That's very helpful, thanks, and I can reproduce this in visual studio

  • I didn't consider that an exception was being caught and ignored. Turns out we aren't holding the GIL when we call back into Python - I've no idea why this is different in 3.9 vs other versions, but the fix is simple and is safe in all versions.

While there is suggested to comment out a line in a file named win32control which I apperantly dont have or find. Neither it seems possible in my compiled files that looks like:

G Áàȉ x@;÷щ

Nor do I understand the wheel solution and what to do with it, since I am still a beginner with hobby experience in python programming.

Update I just found this Q&A but not sure if it is related.

Thingamabobs
  • 7,274
  • 5
  • 21
  • 54
  • Does this answer your question? [Python 'No module named win32gui' after installing pywin32](https://stackoverflow.com/questions/44063350/python-no-module-named-win32gui-after-installing-pywin32) – prakash sellathurai Dec 31 '21 at 15:32
  • @prakashsellathurai well no.. I just linked this question and the suggested answer in my question. This does not solve the issue. – Thingamabobs Dec 31 '21 at 15:33
  • Just installed *Python 3.10.1* and *PyWin32 303* (*pc064*) and didn't encounter your problem. So it must be something fishy in your environment. – CristiFati Jan 01 '22 at 04:11
  • @CristiFati thanks for your reply. Since I installed my earlier version of 3.7.2 again pywin works fine even if I run the code with IDLE Shell 3.10. But I have no idea what I did wrong here and how this is related to the issue. – Thingamabobs Jan 01 '22 at 10:21
  • It's not necessarily something that **you** did wrong. Sometimes install / uninstall are net exactly opposite, and repeating the process, might lead to funny situations. That's why a clean install should be attempted. – CristiFati Jan 01 '22 at 10:44

1 Answers1

0

While it helped me on my other device to just reinstall my older python version, as stated in the comment section:

@CristiFati thanks for your reply. Since I installed my earlier version of 3.7.2 again pywin works fine even if I run the code with IDLE Shell 3.10.

This wasnt possible on my new device, but the Running as a Windows Service helped me out this time.

Manually copy pythonservice.exe from the site-packages/win32 directory to the same place as these DLLs.

Thingamabobs
  • 7,274
  • 5
  • 21
  • 54