1.导入模块win32com
import win32com.client
报错:
Traceback (most recent call last):
File “G:/Pythonxx/Damo.py”, line 3, in
import win32.client
ModuleNotFoundError: No module named ‘win32’
`
2.开始解决:
(venv) G:\Pythonxx>python -m pip install pypiwin32
Collecting pypiwin32
Downloading https://files.pythonhosted.org/packages/d0/1b/2f292bbd742e369a100c91faa0483172cd91a1a422a6692055ac9209
46c5/pypiwin32-223-py3-none-any.whl
Collecting pywin32>=223 (from pypiwin32)
Downloading https://files.pythonhosted.org/packages/d6/39/5c318e0b61d892861fe65a6a3150d42be4d87ae9137be2ef3e356323
41c2/pywin32-223-cp37-cp37m-win32.whl (8.2MB)
0% |▎ | 61kB 4.1kB/s eta 0:33:37
开始下载…
You are using pip version 10.0.1, however version 18.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
3.需要升级pip
(venv) G:\Pythonxx>python -m pip install --upgrade pip
Collecting pip
开始升级
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTim
eoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. (read timeout=15)")': /pack
ages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl
Downloading https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2dda
f940/pip-18.0-py2.py3-none-any.whl (1.3MB)
2% |▊ | 30kB 13kB/s eta 0:01:36
又出错:
raise ReadTimeoutError(self._pool, None, 'Read timed out.')
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read
timed out.
You are using pip version 10.0.1, however version 18.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
4.干脆直接用Pycharm安装:
5.到这里安装成功了。开始吧!