我正在尝试生成.docx
使用 Python 的文件。我搜索了网络和帖子,发现了一个模块:
https://github.com/mikemaccana/python-docx/blob/master/README.markdown https://github.com/mikemaccana/python-docx/blob/master/README.markdown
它说安装使用easy_install
or pip
,我不知道该怎么做。我去了 python 网站,按照 python 文档中给出的说明安装 pip:
http://guide.python-distribute.org/installation.html http://guide.python-distribute.org/installation.html
所以我下载并按照说明进行操作:
$ tar xzf pip-0.7.2.tar.gz
$ cd pip-0.7.2
$ python setup.py install
但是当我执行 python setup.py install 时,我收到错误消息:
Johns-MacBook-Pro:pip-0.7.2 John$ python setup.py install
Traceback (most recent call last):
File "setup.py", line 2, in <module>
from setuptools import setup
ImportError: No module named setuptools
有人可以帮我为新手一步一步安装吗?预先感谢您的所有帮助!
Pip 可以直接从 git 存储库安装
你只需要告诉他使用 git 并给他 git 代表的 URL
pip install git+git://github.com/mikemaccana/python-docx.git
您还需要安装 lxml(如 setup.py 中所写)和 PIL(当您尝试导入模块时您会发现)。
pip install PIL
pip install lxml
pip install python-dateutil
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)