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

DLL load failed #1142

Closed
gbear605 opened this issue Jan 3, 2018 · 1 comment
Closed

DLL load failed #1142

gbear605 opened this issue Jan 3, 2018 · 1 comment

Comments

@gbear605
Copy link

gbear605 commented Jan 3, 2018

I'm trying to run Python code that imports win32com.client. I installed a clean install of Python 3.6.4 and pywin32-221.win32-py3.6.exe.

I'm on 32 bit Window 10.

When I tried to run my code from IDLE, it gave the following traceback:

Traceback (most recent call last):
  File "C:\Users\gbear605\Downloads\StarShoot.py", line 4, in <module>
    import win32com.client
  File "C:\Users\gbear605\AppData\Local\Programs\Python\Python36-32\lib\site-packages\win32com\__init__.py", line 5, in <module>
    import win32api, sys, os
ImportError: DLL load failed: The specified module could not be found.

I noticed that in File Explorer, there was also an option for "Edit with Pythonwin" when I right-clicked on my Python source file, so I tried that. It errors by saying that it is missing "VCRUNTIME140.dll," so I installed the Visual C++ Redistributable Packages. After installing that, I get the same traceback in IDLE but Pythonwin now errors with "Still can't get my hands on win32ui."

However, if I directly open Pythonwin and then run the file, it works fine.

@Avasam
Copy link
Collaborator

Avasam commented Mar 17, 2024

Since 71afa71, the PATH is now prepended, rather than appended. For Python >= 3.8, the PATH environment variable isn't even used. This is included in pywin32==226.

Python 3.7 has also reached EOL (meaning no security fixes/support) and I'd recommend migrating over to 3.8+ (see #2207)

.exe installers are now deprecated #1939, so you should install from PyPI (ie: pip install pywin32>=226)

Given the sheer amount of "ImportError: DLL load failed: The specified module could not be found." issue duplication and old history, I'd like to consolidate the current state of these issues. So I'll close and reference back any issue that only has comments showing the issue:

  • from before November 10th, 2019 (pywin32<226)
  • using .exe installers
  • using Python < 3.8

Please also try https://github.com/mhammond/pywin32#troubleshooting before opening a new issue, or let us, and others, know if it did resolve your issue.

@Avasam Avasam closed this as completed Mar 17, 2024
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

2 participants