iromlab icon indicating copy to clipboard operation
iromlab copied to clipboard

ImportError: No system module 'pywintypes' (pywintypes38.dll)

Open bitsgalore opened this issue 5 years ago • 21 comments

Install of Iromlab on new Windows 10 machine results in following error when running iromlab-launch.py of iromlab-configure.py from source repo:

ImportError: No system module 'pywintypes' (pywintypes38.dll)

For a pip install the config and launch script simply run without anything happening.

bitsgalore avatar Mar 04 '20 16:03 bitsgalore

See also:

https://stackoverflow.com/questions/18907889/importerror-no-module-named-pywintypes and

https://stackoverflow.com/questions/25254285/pyinstaller-importerror-no-system-module-pywintypes-pywintypes27-dll.

Made a check for package pypiwin32, which is is actually installed. Following the recommendation here I looked at this folder:

C:\Users\JKN010\AppData\Roaming\Python\Python38\site-packages\pywin32_system32

I then copied the files 'pythoncom38.dll' and 'pywintypes38.dll' over to:

C:\Users\JKN010\AppData\Roaming\Python\Python38\site-packages\win32\lib 

After this everything works OK. Ugly hack though, there must be a cleaner way to do this?

Side note: worth mentioning that so far I've only tried doing a user install of Iromlab and its dependencies. Should test what happens with a global install.

bitsgalore avatar Mar 04 '20 16:03 bitsgalore

very odd had the same problem will try your solution

minecraft3r217 avatar May 28 '20 08:05 minecraft3r217

Interesting but it really works.. Thank you very much.. Saved my hours.

JohnS-coder avatar Jul 04 '20 01:07 JohnS-coder

Thank you so much @bitsgalore for me this error occured in pyttsx3 library and this same hack worked

meicheerze avatar Sep 10 '20 05:09 meicheerze

win32\lib

thanks it resolves my issue

rajchauhan28 avatar Oct 16 '20 15:10 rajchauhan28

@bitsgalore Thank you

yogeshk04 avatar Dec 08 '20 16:12 yogeshk04

Thank you this worked for me

Redshift1949 avatar Dec 18 '20 22:12 Redshift1949

OHMG worked

extorc avatar Jan 02 '21 08:01 extorc

Thank you!

algo-1 avatar Jan 14 '21 17:01 algo-1

it worked thanks so much!

TrinhtrungTH avatar Feb 15 '21 16:02 TrinhtrungTH

thanks

jiaochenglong avatar Mar 09 '21 06:03 jiaochenglong

thank you so much!

KADIAPRIYANSHU avatar Jun 16 '21 08:06 KADIAPRIYANSHU

Excellent! Also worked for me like a charm. Many thanks!! :-) (Note: Issue related to pyttsx3).

jorgelex008 avatar Jun 27 '21 18:06 jorgelex008

Thank you very much very much

mohamad22mk avatar Jul 19 '21 19:07 mohamad22mk

Thanks

StrivingRabbit avatar Mar 29 '23 16:03 StrivingRabbit

Update - pywin32 readme now mentions a post-install script that's supposed to resolve import errors. See:

https://pypi.org/project/pywin32/

If you encounter any problems when upgrading (eg, "module not found" errors or similar), you should execute:

python Scripts/pywin32_postinstall.py -install

This will make some small attempts to cleanup older conflicting installs.

Note that if you want to use pywin32 for "system wide" features, such as registering COM objects or implementing Windows >Services, then you must run that command from an elevated (ie, "Run as Administrator) command prompt.

Needs further testing/confirmation (don't have access to a Win 11 environment at the moment).

bitsgalore avatar Dec 04 '23 15:12 bitsgalore

Made a check for package pypiwin32, which is is actually installed. Following the recommendation here I looked at this folder:

C:\Users\JKN010\AppData\Roaming\Python\Python38\site-packages\pywin32_system32

I then copied the files 'pythoncom38.dll' and 'pywintypes38.dll' over to:

C:\Users\JKN010\AppData\Roaming\Python\Python38\site-packages\win32\lib 

After this everything works OK. Ugly hack though, there must be a cleaner way to do this?

Side note: worth mentioning that so far I've only tried doing a user install of Iromlab and its dependencies. Should test what happens with a global install.

I'm trying to do a user install of IROMLAB and am experiencing this issue, despite moving these files. Running Windows 10, python 3.12.3 (files were named pythoncom312.dll and pywintypes312.dll, not sure if that matters). Please let me know if there's any information I can provide to help troubleshoot this. I'm really bummed I can't get IROMLAB up and running!

mehclere avatar Apr 16 '24 19:04 mehclere

@mehclere Not 100% sure, but this is probably related to below issue (and even if it isn't, you'll eventually run into it anyway):

https://github.com/KBNLresearch/iromlab/issues/107

As a workaround, try if you can make it work with Python 3.11 or earlier (you may need to apply the dll fixes).

Meanwhile I'll have a look at how to remove the imp dependency, hopefully I'll get round to this one of these weeks.

Other thing to watch out for, is that I've heard some reports of issues when using Iromlab in conjunction with the latest (5.x) versions of IsoBuster. To be on the safe side I'd recommend to use the most recent 4.x release of IsoBuster (4.9, if I recall correctly). This is also something I'll try to sort out at some point, but this probably won't happen anytime soon.

bitsgalore avatar Apr 16 '24 20:04 bitsgalore

@bitsgalore thank you so much for your quick response, using the earlier version of Python worked! I will inform you if I run into any issues with IsoBuster 5.3.

mehclere avatar Apr 17 '24 12:04 mehclere

@mehclere See also https://github.com/KBNLresearch/iromlab/issues/109; in particular if you run into any unexplained IsoBuster 1005 errors, you might want to give IsoBuster 4.9 a try. IsoBuster's author did some major refactoring of the codebase in version 5.0, so there could be some more surprises (especially because I don't think many IsoBuster users use its command-line interface, which is how Iromlab wraps it internally).

bitsgalore avatar Apr 17 '24 13:04 bitsgalore

Thank you! Saved me hours

mford99 avatar Jun 10 '24 18:06 mford99