-
Notifications
You must be signed in to change notification settings - Fork 792
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: DLL load failed while importing win32gui: The specified procedure could not be found #1730
Comments
I'm getting a similiar issue with pywin32 v301. DLL load failed while importing win32security: The specified procedure could not be found. Works fine in pywin32 v300. Windows 10 build 18363, python 3.8.6 |
I'm getting identical issues for python 3.6 versions with pywin32-301. Don't see any problem with higher python versions. |
@mmaylat @primal100 after uninstall with pip then creating conda env with reboot it worked (pywin32 is defult installed in conda env) |
We are also seeing this on Python 3.6.6, during |
Getting similar issue when installed via pip.
System background:
One of the workarounds that actually worked was just to downgrade to version 300:
or revert to initial conda distribution (version 228):
Another was to remove any existing dlls and copy valid ones in import os
import sys
import glob
import shutil
import distutils.sysconfig
lib_dir = distutils.sysconfig.get_python_lib(plat_specific=1)
files = glob.glob(os.path.join(lib_dir, "pywin32_system32\\*.*"))
bases = [os.path.basename(file) for file in files]
bad_dest_dirs = [
os.path.join(sys.prefix, "Library\\bin"),
os.path.join(sys.prefix, "Lib\\site-packages\\win32"),
]
for base in bases:
for bad_dest_dir in bad_dest_dirs:
bad_fname = os.path.join(bad_dest_dir, base)
if os.path.exists(bad_fname):
os.unlink(bad_fname)
for file in files:
shutil.copy(file, sys.prefix) |
I suspect this will work better in build 303, but please reopen if it doesn't (but see also https://github.com/mhammond/pywin32#the-specified-procedure-could-not-be-found--entry-point-not-found-errors) |
|
Note for people hitting this after upgrading to pywin32 version 305: The way |
this was helpful to me I embed python in another application using Py_RunSimpleString. on version 305 everything works and the dlls are found there in ..Lib\site-packages\pywin32_system32 But on release 306 the dlls are simply not found anymore I downgraded because it was easier in my case, I believe that copying to sys.prefix should work aswell |
when trying to import win32gui or win32api this is the output error
'''
C:\Users\m\Desktop\auto timer>main.py
Traceback (most recent call last):
File "C:\Users\m\Desktop\auto timer\main.py", line 3, in
import win32gui
ImportError: DLL load failed while importing win32gui: The specified procedure could not be found.
'''
after install pywin32 for the first time it was working but now it doesn't
what i have tried to solve this proplem:
----- reinstall pywin32 (it dosnot work )
-----create a conda env it doesn't work ( i have python installed seperatly , mini conda for ven only )
her is my system info
OS Name: Microsoft Windows 10 Home Single Language
OS Version: 10.0.19042 N/A Build 19042
Python 3.9.5
Name: pywin32
Version: 301
conda 4.10.3
The text was updated successfully, but these errors were encountered: