-
Notifications
You must be signed in to change notification settings - Fork 798
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
import win32api
fails after pip install pywin32
(ImportError: DLL load failed: The specified module could not be found)
#1399
Comments
I was able to resolve this by copying two DLLs:
But, ideally, this is not required on a fresh install. |
Hello @theonewolf, could you be so kind and run Python in your venv again and run the following lines?
Normally our .pth file within the site-packages directory should ensure that the .dll files can be found. However, due to your venv setup, it seems that something is mixed up there. Thanks! |
Is it possible you have either a pythoncomXX.dll or pywintypesXX.dll in your system32 directory? |
I have the same problem. Have you solved it? |
I had the same problem, but with version 225. Version 224, on the other hand, worked just fine for me. I was able to fix this by removing the files Possibly this issue is related to the issues #1406 and #1409. |
I just installed 32-bit Python 3.8b04 on Windows and then tried
and ended up needing to copy the DLLs from Where are these binaries
supposed to go when one runs
|
For me the issue had been caused by old versions of Possibly the issue can be solved by prepending the
|
|
I copy this two dll into my system32 directory, but error still appear. also I add pywin32_system32 in my system environment varialble, but still did not work. I installed python 3.7.4 in my wide system and import win32com works for me, but i want to able to run it from another location. thanks. |
my python is:
i copy the pythoncom37.dll pywintypes37.dll to C:\Windows\System32 but not work for me. there are error: ImportError: DLL load failed: %1 Win32 。 |
pywintypes38.dll isn't found when importing win32api after pip installing pywin32, but explicitly importing pywintypes finds it and allows win32api to be loaded. See mhammond/pywin32#1399
@azoellner 's suggestion of prepending the path has been done in 71afa71 for Python versions older than 3.8. For Python >= 3.8, the 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: 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:
Please also try https://github.com/mhammond/pywin32#troubleshooting before opening a new issue, or let us, and others, know here if it did fix your issue. If you're having this issue with Jupyter Notebooks, refer to #1409 instead. |
import win32api
fails after pip install pywin32
import win32api
fails after pip install pywin32
(ImportError: DLL load failed: The specified module could not be found)
Expected behavior and actual behavior.
Expected
import win32api
to work without any exception.Steps to reproduce the problem.
Below I am working in a
virtualenv
; however, this same problem occurs when I install not inside avenv
(I just solved it for my system, so it's easier to illustrate inside avenv
now).With more verbosity, my steps look like:
Version of Python and pywin32
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:13:57) [MSC v.1916 64 bit (AMD64)] on win32
pywin32-224-cp37-cp37m-win_amd64.whl
The text was updated successfully, but these errors were encountered: