docx模塊報錯
python安裝docx模塊出現Import Error: No module named 'exceptions'的解決方案
注意:docx是python2的模塊,python3的第三方模塊還沒進行更新,所以不好使了,所以,你在python3中安裝docx模塊可以安裝,但是import docx運行就報錯
pip install docx不會報錯的
解決方法:
①pip uninstall docx (把原來安裝的docx卸載掉)
②下載指定檔案:
去https://www.lfd.uci.edu/~gohlke/pythonlibs/網站,找以下名字的檔案
python_docx-0.8.10-py2.py3-none-any.whl

左鍵點擊,把他下下來
③打開你python3安裝目錄
將剛才下載的檔案放進去

再摁住shift+右鍵(或者你可以打開cmd再輸入下面的命令也行)

再輸入下面的命令,安裝docx,這回就可以使用了額
pip3 install python_docx-0.8.10-py2.py3-none-any.whl
再import docx就可以用了
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/146924.html
標籤:Python
上一篇:Python模擬用戶登錄場景
下一篇:Python--字典操作
