Python 3.x 安装exceptions失败问题
我在使用 docx模块的时候发现提示ModuleNotFoundError: No module named 'exceptions’错误,然后我就去安装这个exceptions包,发现安装失败,记录下此次问题的原因和解决办法。
- 操作指令:
pip install exceptions
- 现象:
ERROR: You must give at least one requirement to install (see "pip help install")
-
原因:
Python 3.x 版本移除了exceptions模块,但是docx包中引用了该模块。 -
解决办法
安装python-docx模块即可
pip install python-docx
Collecting python-docx
Downloading python-docx-0.8.11.tar.gz (5.6 MB)
---------------------------------------- 5.6/5.6 MB 259.3 kB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Requirement already satisfied: lxml>=2.3.2 in e:\python\3.9.13\lib\site-packages (from python-docx) (4.9.3)
Using legacy 'setup.py install' for python-docx, since package 'wheel' is not installed.
Installing collected packages: python-docx
Running setup.py install for python-docx ... done
Successfully installed python-docx-0.8.11