PyWin32 and Python 3.8.0

Python 3.8.0 has been recently released (on 20191014, and can be downloaded from [Python]: Python 3.8.0).
PyWin32 has builds for it on [PyPI]: pywin32 225 (released on 20190915). Unfortunately, after pip installing, it doesn’t work.

Sample:

[cfati@CFATI-5510-0:e:\Work\Dev\StackOverflow\q058631512]> sopr.bat
*** Set shorter prompt to better fit when pasted in StackOverflow (or other) pages ***

[prompt]> "e:\Work\Dev\VEnvs\py_064_03.07.03_test0\Scripts\python.exe"
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import win32api
>>> ^Z


[prompt]> "e:\Work\Dev\VEnvs\py_064_03.08.00_test0\Scripts\python.exe"
Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import win32api
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: DLL load failed while importing win32api: The specified module could not be found.
>>> ^Z

Notes:

  • For Python 3.7, I also upgraded my PyWin32 module to the latest, and it works
  • Older PyWin32 versions work on older Python versions (2.73.53.6)
  • Reproducible on 64bit and 32bit

Spoiler alert!!!

Applied #2.2. (from below) to the original .whls, and published them on [GitHub]: CristiFati/Prebuilt-Binaries – (master) Prebuilt-Binaries/PyWin32/v225 (win_amd64win32 for Python 3.8).

After installing (one of) them, existing code should work OOTB (with respect to this issue).

Install steps:

  1. Download the .whl that matches your Python architecture (64bit32bit – for more details on getting Python architecture, check [SO]: How do I determine if my python shell is executing in 32bit or 64bit mode on OS X? (@CristiFati’s answer) (the question is about OSX, but other platforms are covered as well)), it will most likely be 64bit (win_amd64), from the above URL.
    For example, I downloaded it in L:\Downloads

This Post Has One Comment

  1. sovis

    Install pywin32 v225 with pycharm on python 3.8.

    importing pywin types before win32api

    import pywin types
    import win32api

Leave a Reply