Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bitsgalore opened this issue Mar 4, 2020 · 21 comments
Open

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

bitsgalore opened this issue Mar 4, 2020 · 21 comments

Comments

@bitsgalore
Copy link
Member

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
Copy link
Member Author

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.

@minecraft3r217
Copy link

very odd had the same problem will try your solution

@JohnS-coder
Copy link

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

@meicheerze
Copy link

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

@rajchauhan28
Copy link

win32\lib

thanks it resolves my issue

@yogeshk04
Copy link

@bitsgalore Thank you

@Redshift1949
Copy link

Thank you this worked for me

@extorc
Copy link

extorc commented Jan 2, 2021

OHMG worked

@algo-1
Copy link

algo-1 commented Jan 14, 2021

Thank you!

@TrinhtrungTH
Copy link

it worked
thanks so much!

@jiaochenglong
Copy link

thanks

@KADIAPRIYANSHU
Copy link

thank you so much!

@jorgelex008
Copy link

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

@mohamad22mk
Copy link

Thank you very much very much

@StrivingRabbit
Copy link

Thanks

@bitsgalore
Copy link
Member Author

bitsgalore commented Dec 4, 2023

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).

@mehclere
Copy link

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!

@bitsgalore
Copy link
Member Author

bitsgalore commented Apr 16, 2024

@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):

#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.

@mehclere
Copy link

@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.

@bitsgalore
Copy link
Member Author

bitsgalore commented Apr 17, 2024

@mehclere See also #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).

@mford99
Copy link

mford99 commented Jun 10, 2024

Thank you! Saved me hours

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests