今天写代码遇到这个问题 ModuleNotFoundError: No module named 'win32api',查了下是因为少了 win32api 这个模块。
安装一下就解决了:
C:UsersSam>pip install pypiwin32
Collecting pypiwin32
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None))
after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection
.VerifiedHTTPSConnection object at 0x039712B0>, 'Connection to files.pythonhoste
d.org timed out. (connect timeout=15)')': /packages/d0/1b/2f292bbd742e369a100c91
faa0483172cd91a1a422a6692055ac920946c5/pypiwin32-223-py3-none-any.whl
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None))
after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection
.VerifiedHTTPSConnection object at 0x03971370>, 'Connection to files.pythonhoste
d.org timed out. (connect timeout=15)')': /packages/d0/1b/2f292bbd742e369a100c91
faa0483172cd91a1a422a6692055ac920946c5/pypiwin32-223-py3-none-any.whl
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None))
after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection
.VerifiedHTTPSConnection object at 0x03971390>, 'Connection to files.pythonhoste
d.org timed out. (connect timeout=15)')': /packages/d0/1b/2f292bbd742e369a100c91
faa0483172cd91a1a422a6692055ac920946c5/pypiwin32-223-py3-none-any.whl
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None))
after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection
.VerifiedHTTPSConnection object at 0x03971330>, 'Connection to files.pythonhoste
d.org timed out. (connect timeout=15)')': /packages/d0/1b/2f292bbd742e369a100c91
faa0483172cd91a1a422a6692055ac920946c5/pypiwin32-223-py3-none-any.whl
Downloading https://files.pythonhosted.org/packages/d0/1b/2f292bbd742e369a100c
91faa0483172cd91a1a422a6692055ac920946c5/pypiwin32-223-py3-none-any.whl
Collecting pywin32>=223 (from pypiwin32)
Downloading https://files.pythonhosted.org/packages/e9/5a/04eaf2ae543fb078f1e6
f9be7c29149846e3f054a4111bfdfdd3510b7f58/pywin32-227-cp36-cp36m-win32.whl (8.3MB