0

I am using Python 3.6.7 in conda 4.5.12 (Win10,64bit) and I want to compile my Python project to an .exe-File using Pyinstaller (3.5 dev). I keep getting the same error:

ModuleNotFoundError: No module named 'win32api'
[65600] Failed to execute script pyi_rth_win32comgenpy

I already reinstalled pywin32 as recommended in 25314463, the import of win32com works. I also tried:

pip install pypiwin32

as described in 21343774. The Installation was successful. But I still get the same Error.

pip install pywin32

from 827 does not solve the problem either. Also I tried to import win32api, win32com and pywin32 in my .spec-file with the matching paths, but still no success.

How can this error be fixed?

musicformellons
  • 12,283
  • 4
  • 51
  • 86
R.WF
  • 1
  • 1
  • 1

2 Answers2

1

Sometimes it happened to me on Windows that installed package is not visible. Try first uninstalling it:

pip uninstall pypiwin32

Make sure it has been removed:

pip list

Then install from scratch:

pip install --no-cache pypiwin32

Make sure it is installed:

pip list

You might see pywin32 in the list.

grapes
  • 8,185
  • 1
  • 19
  • 31
  • Thank you for your answer! Unfortunately this doesnt solve my problem. The error persists. When I initially try to execute the progamm the error appears: _ERROR loading Python DLL (python36.dll)_ But after added this DLL to the folder, this error disappears. Does this may have something to do with the win32api error? – R.WF Jan 14 '19 at 08:59
  • That's strange behavior, maybe you have a mix of Python version onboard? In this case it can happen with you to install library to another Python. I would try 1) reinstall Python 2) install library in a clean virtual env – grapes Jan 14 '19 at 09:09
0

Just pypiwin32 didn't do it for me. It worked only when I uninstalled all libs related to pywin32 and then installed again

Tiago Santos
  • 726
  • 6
  • 13