error: can't copy 'docx\templates\default-docx-template': doesn't exist or not a regular file --------------- Failed building wheel for python-docx; python-docx的安装使用;python操作word

本人第一安装python-docx很不幸就出现了,如下的错误:(如果你也遇到同样的错误,不要慌可以参考下面解决方案,由于第一次处理这种错误,如有不对欢迎大家多多批评指正

error: can't copy 'docx\templates\default-docx-template': doesn't exist or not a regular file    ---------------  Failed building wheel for python-docx; python-docx的安装使用;python操作word

问题所在是因为我们的setuptools版本太低了

解决办法:

1.首先进行升级

pip install -U setuptools

error: can't copy 'docx\templates\default-docx-template': doesn't exist or not a regular file    ---------------  Failed building wheel for python-docx; python-docx的安装使用;python操作word

2.切换到扩展库的安装目录执行以下命令       pip install python-docx

error: can't copy 'docx\templates\default-docx-template': doesn't exist or not a regular file    ---------------  Failed building wheel for python-docx; python-docx的安装使用;python操作word

error: can't copy 'docx\templates\default-docx-template': doesn't exist or not a regular file    ---------------  Failed building wheel for python-docx; python-docx的安装使用;python操作word

3.验证

# ecoding=utf-8
from docx import Document document = Document('D:\\11.docx') #打开文件demo.docx
for paragraph in document.paragraphs:
print(paragraph.text) #打印各段落内容文本 document.add_paragraph(
'Add new paragraph', style='ListNumber'
) #添加新段落 document.save('demo.docx') #保存文档

error: can't copy 'docx\templates\default-docx-template': doesn't exist or not a regular file    ---------------  Failed building wheel for python-docx; python-docx的安装使用;python操作word

上一篇:ASP.NET Zero--4.不使用谷歌字体,提升加载速度


下一篇:【知识点】H264, H265硬件编解码基础及码流分析