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

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

解决办法:

1.首先进行升级

pip install -U setuptools

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

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的更多相关文章

  1. error MSB3073: 命令“copy /y

    编译VC程序时候报错:error MSB3073: 命令“copy /y 查看: 项目的属性->配置属性->生成事件->后期生成事件->命令行: copy /y "$ ...

  2. C#中使用Spire.docx操作Word文档

    使用docx一段时间之后,一些地方还是不方便,然后就尝试寻找一种更加简便的方法. 之前有尝试过使用Npoi操作word表格,但是太烦人了,随后放弃,然后发现免费版本的spire不错,并且在莫种程度上比 ...

  3. python-docx操作word文件(*.docx)

    目录 基础操作 对象关系 添加样式 中文字体微软雅黑,西文字体Times New Roman 首行缩进 单独设置标题样式 设置超链接 参考文档 基础操作 from docx import Docume ...

  4. Jenkins 发布平台 MSB4064: The "Retries" parameter is not supported & error MSB4063: The "Copy" task could not be initialized

    ____________________________________________________________________________________________________ ...

  5. DocX操作word生成报表

    1.DocX简介 1.1 简介 DocX是一个在不需要安装word的情况下对word进行操作的开源轻量级.net组件,是由爱尔兰的一个叫Cathal Coffey的博士生开发出来的.DocX使得操作w ...

  6. git init error:Malformed value for push.default: simple

    git init error:Malformed value for push.default: simple 1.git config --global push.default matching

  7. 异常:Error resolving template "xxx", template might not exist or might not be accessible...解决办法

    在开发环境下正常,但使用jar运行时,报错Error resolving template template might not exist or might not be accessible,意思 ...

  8. Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable t

    spring与hibernate整合然后出现如下错误: org.springframework.beans.factory.BeanCreationException: Error creating ...

  9. Oracle重启 error: ora-01034:oracle not available ora-27101:shared memory realm does not exist

    error: ora-01034:oracle not available ora-27101:shared memory realm does not exist 苦咖啡 他的博客中一篇文章完美的解 ...

随机推荐

  1. Idea中一些常用设置

    idea展开和折叠方法的快捷键 Ctrl+”+/-”,当前方法展开.折叠Ctrl+Shift+”+/-”,全部展开.折叠 idea中也有自定代码块的功能 //region 描述.....业务代码//e ...

  2. VUE 滚动插件(better-scroll)

    1. 概述 1.1 说明 better-scroll是一款重点解决移动端(已支持PC)各种滚动场景需求的插件.例如淘宝聚划算中的类型选择(女装/家纺/生鲜美食等),没有滚动条显示却实现了滚动功能. 1 ...

  3. C++中的继承(3)作用域与重定义,赋值兼容规则

    1.作用域与重定义(同名隐藏) 一样的,先上代码 1 class A 2 { 3 public: 4 int a_data; 5 void a() 6 { 7 cout << " ...

  4. ubuntu18.04使用SPFlashTool提示缺少libpng12.so.0

    Ubuntu libpng12无法安装解决 Ubuntu 14以上就已经不再支持libpng12,然而有些软件又依赖于libpng12(如我要使用的Cisco Packet Tracer).我们可以采 ...

  5. docker 安装使用 mssql2017

    1.拉取镜像 官方文档参考 : https://docs.microsoft.com/zh-cn/sql/linux/quickstart-install-connect-docker?view=sq ...

  6. Gradle 打包上传至私有仓库配置

    allprojects{ apply plugin: 'java' apply plugin: 'idea' apply plugin: 'maven' group 'com.xxxxx.base' ...

  7. git20181122

    git 在线编辑器 http://www.mdeditor.com/git add commit diff log status 代码撤消 # git https://github.com/gyz41 ...

  8. java解析json的操作

    import java.io.FileNotFoundException; import java.io.FileReader; import com.google.gson.JsonArray; i ...

  9. MySql恢复密码的过程

    密码是一个非常重要的东西,所以往往设置的很复杂,也往往一不小心.......就忘了  : ( 很多童鞋在Linux下看到一堆命令行往往都是一脸懵逼,不知从何下手,这里记录了下基本的恢复操作以备不时之需 ...

  10. python第六天(元组、字典、集合)

    一.元组(tuple) 作用:存多个值,对比列表来说,元组不可变(是可以当做字典的key的),主要用来读 定义:与列表类型相比,只不过把[ ]换成() age=(11,22,33,44,55)prin ...