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

Python3.7 only supports pywin32 (223). Any higher version will produce DLL load failed: The specified procedure could not be found #1507

Closed
Coderx7 opened this issue Apr 28, 2020 · 6 comments

Comments

@Coderx7
Copy link

Coderx7 commented Apr 28, 2020

I noticed any versions higher than 223 wont work with Python3.7.4 and will generate :

ImportError: DLL load failed: The specified procedure could not be found.

I tested different approaches and yes I do run the pywin32_postinstall.py -install for all versions.
There is also something weird and that is, intrestingly, importing modules in PythonWin doesnt issue any errors at all while basically everywhere else the error exists and turns up!

  • Expected behavior: Newer versions should also work well on Python3.7.4

  • Atual behavior: Only version 223 works with Python 3.7.4

  • Steps to reproduce the problem :

    1. Install the Python3.7.4,
    2. Install Pywin32 the latest version (either using the installer or pip)
    3. Import win32api
  • Version of Python and pywin32
    Python:

Python 3.7.4 (default, Aug  9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32

pywin32 : all versions greater than 223 wont work

224, 225, 226, 227
@mhammond
Copy link
Owner

Anaconda's Python packages parts of an old pywin32. See #1409, #1406, #1180, etc - I really should clean these up and dupe some against each other, but I think #1409 has the clearest description. I'm going to close this as I don't think it adds anything new to those issues, but I'm happy to reopen if that's wrong.

@Coderx7
Copy link
Author

Coderx7 commented Apr 28, 2020

Thanks a lot really appreciate it. managed to solved it based on this comment .
Basically this as you said was caused because of the "Older" dlls still be residing some where and thus not allowing for the newer dlls to replace them.
What I actually did was to uninstall the old version (my current version) then Installed Everything and searched for these two DLLs : ( pythoncom37.dll and pywintypes37.dll) and lo and behold! there were dozens of them scattered in different anaconda3's directories and also in system32.
I deleted all of them. (Important note, I also had to close any open editor, in my case my VSCode) and then simply did :

pip install pywin32

followed by

python Scripts\pywin32_postinstall.py -install

and thats it. all is fine now and the DLL issue is gone for good!
Thank you very much for your prompt reply and help.
Have a wonderful day sir ;)

by the way, here is a screenshot of all the folders that had these two DLLs in them (taken from my recycle bin) in case it might come in handy later on for anyone out there :
image

@johann-petrak
Copy link

I just got this bug after installing miniconda and python 3.9 in a separate environment and subsequently other packages using pip.

I never installed pywin32 explicitly.

Then Jupyter notebook did not work and I found this jupyter issue: jupyter/notebook#4980

Running python [environment path]/Scripts/pywin32_postinstall.py -install fixed this, but how on earth is this supposed to be something a user needs to do and figure out?

@mhammond
Copy link
Owner

The problem is that jupyter bundles them in non-standard places. There's really no way pywin32 can know about that. You should file a bug asking them to install it via pip, or otherwise installed somewhere that a user trying to upgrade via pip succeeds.

@johann-petrak
Copy link

Thanks, I was trying to figure out whose bug this is!

@johann-petrak
Copy link

So it seems ultimately this should get dealt with by Anaconda see conda-forge/pywin32-feedstock#18

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

3 participants