3

I get this error when I run a program:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-10-b045b37982bc> in <module>()
      4 #speech recognition
      5 import speech_recognition as sr
----> 6 import win32com.client
      7 import comtypes.client
      8 #speech synthesis

ModuleNotFoundError: No module named 'win32com'

---------------------------------------------------

When I tried to install the pypiwin32 module, I got this error:

 Collecting pypiwin32
  Using cached pypiwin32-223-py3-none-any.whl
Collecting pywin32>=223 (from pypiwin32)
  Could not find a version that satisfies the requirement pywin32>=223 (from pypiwin32) (from versions: )
No matching distribution found for pywin32>=223 (from pypiwin32)
iled
  • 2,142
  • 3
  • 31
  • 43
Pedro Henrique
  • 31
  • 1
  • 1
  • 2
  • 1
    I haven't used it in a long time, but at least a few years ago, you couldn't install `pywin32` via `pip` (partly because it requires running a post-install script with elevated privs even if you install into a user-writable location); you had to go to Mark Hammond's site to download and run the installer. – abarnert Mar 15 '18 at 19:02

1 Answers1

4

The problem is that pypiwin32 depends on pywin32, and, as the README says:

Note that PIP support is experimental.

Even if pip installs pywin32, you still have to manually run the post-install script with elevated privileges. So, rather than debugging why the experimental pip support isn't working for you, it's probably better to manually download the appropriate installer from the Releases page and run it.

Once that completes, pip should know that you now have pywin32 version 223 installed, so pip install pypiwin32 should hopefully work.

You might want to look through the pywin32 issues to see if anyone has reported this problem (it may only be mentioned in some issue about completing pip support, not a separate one) and, if not, file a bug report. That way, the next time someone wants to use pypiwin32, they may not even need this answer. (Since Mark Hammond, the main author of pywin32, is also listed as a maintainer of pypiwin32, I'm guessing he already knows about it—but it can't hurt to check.)

abarnert
  • 354,177
  • 51
  • 601
  • 671