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

__import_pywin32_system_module_ function is not finding pywintypesXX.dll even if it exists #2298

Open
Ilyeshaddad337 opened this issue Jun 21, 2024 · 1 comment
Labels

Comments

@Ilyeshaddad337
Copy link

Expected behavior and actual behavior

when I import the win32com.client module i get this error
python DLL load failed: The specified module could not be found
the line producing the error is :
python \venv\lib\site-packages\win32\lib\pywintypes.py line 118 in __pywin32_system_module__ mod = importlib.util.module_from_spec(spec)
when i print the spec variable that is defined just above that line i see that it contains the correct path to the dll:
python ModuleSpec(name='pywintypes', loader=<_frozen_importlib_external.ExtensionFileLoader object at 0x0000020060A79208>, origin='C:\\Users\\ilyes\\Documents\\venv\\lib\\site-packages\\pywin32_system32\\pywintypes37.dll')

Steps to reproduce the problem

just import the win32com.client module

System information

Python version and distribution:
python3.7 , windows

pywin32 version:
pywin32==306 installed via pip

Windows Version:
windows 10 22H2 19045.4412 installed on virtual machine

DLL locations:
pythoncom37.dll
pywintypes37.dll
are found on venv\lib\site-packages\pywin32_system32\

@Avasam Avasam added the bug label Jun 22, 2024
@mhammond
Copy link
Owner

This probably means the dependencies for pywintypes37.dll can't be found - eg, maybe the MSVC redistributables. A "dependency" tool, such as https://www.dependencywalker.com/, might be able to shed more light here.

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

No branches or pull requests

3 participants