KBNLresearch / iromlab

Loader software for automated imaging of optical media with Nimbie disc robot
Apache License 2.0
31 stars 5 forks source link

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

Open bitsgalore opened 4 years ago

bitsgalore commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

very odd had the same problem will try your solution

JohnS-coder commented 4 years ago

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

meicheerze commented 3 years ago

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

rajchauhan28 commented 3 years ago

win32\lib

thanks it resolves my issue

yogeshk04 commented 3 years ago

@bitsgalore Thank you

Redshift1949 commented 3 years ago

Thank you this worked for me

extorc commented 3 years ago

OHMG worked

algo-1 commented 3 years ago

Thank you!

TrinhtrungTH commented 3 years ago

it worked thanks so much!

jiaochenglong commented 3 years ago

thanks

KADIAPRIYANSHU commented 3 years ago

thank you so much!

jorgelex008 commented 3 years ago

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

mohamad22mk commented 3 years ago

Thank you very much very much

StrivingRabbit commented 1 year ago

Thanks

bitsgalore commented 8 months ago

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 commented 4 months ago

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 commented 4 months ago

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

mehclere commented 4 months ago

@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 commented 4 months ago

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

mford99 commented 2 months ago

Thank you! Saved me hours