python docx安装报错regular file_无法安装pythondocx(MacOS)

在尝试安装python-docx包时遇到ImportError,按照建议使用`pip install python-docx`命令,但出现了错误,错误信息提到不能复制'docx/templates/default-docx-template',因为它不存在或者不是一个常规文件。安装过程在Python 2.7.15环境下执行,最终安装失败,返回错误代码1。
摘要由CSDN通过智能技术生成

我正在尝试安装docx包。但是得到以下ImportError:

ImportError: cannot import name Document

因此,正如建议的here,我试着:

pip install python-docx

但是得到以下错误(python版本:2.7.15)..

..

..

creating build/lib/docx/templates

copying docx/templates/default-header.xml -> build/lib/docx/templates

copying docx/templates/default-settings.xml -> build/lib/docx/templates

copying docx/templates/default-footer.xml -> build/lib/docx/templates

error: can't copy 'docx/templates/default-docx-template': doesn't exist or not a regular file

Command

/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import

setuptools,tokenize;__file__='/private/var/folders/0c/v_yb4q7n2h3fg94rlfrr165r0000gn/T/pip-build-ks26RP/python-docx/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n',

'\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/0c/v_yb4q7n2h3fg94rlfrr165r0000gn/T/pip-1SQvtb-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/0c/v_yb4q7n2h3fg94rlfrr165r0000gn/T/pip-build-ks26RP/python-docx/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值