pip install openpyxl
Collecting openpyxl
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fea6e1b0a00>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /packages/6a/94/a59521de836ef0da54aaf50da6c4da8fb4072fb3053fa71f052fd9399e7a/openpyxl-3.1.2-py2.py3-none-any.whl
File "/usr/local/lib/python3.9/dist-packages/pip/_vendor/urllib3/response.py", line 443, in _error_catcher
raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out
使用国内源:
使用国内的 PyPI 镜像源可能会改善下载速度。你可以使用清华大学的 PyPI 镜像,通过以下命令配置:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ python-docx
然后再执行:
pip install openpyxl 或者 python3 -m pip install openpyxl
pip install PyMuPDF 或 python3 -m pip install PyMuPDF
pip install python-pptx 或 python3 -m pip install --upgrade python-pptx
pip install python-docx 或 python3 -m pip install --upgrade python-docx
本地执行:python3 word.py https://a.cn/a.docx