我正在尝试安装python,所以我输入了cmd。
easy_install python-docx并得到:
Searching for python-docx
Best match: python-docx 0.7.4
Processing python_docx-0.7.4-py2.6.egg
python-docx 0.7.4 is already the active version in easy-install.pth
Using c:\python26\lib\site-packages\python_docx-0.7.4-py2.6.egg
Processing dependencies for python-docx
Finished processing dependencies for python-docx但是当我打开python并键入:
进口docx
我得到了:
File "c:\python26\lib\site-packages\docx-0.2.4-py2.6.egg\docx.py", line 17, in <
module>
from lxml import etree
ImportError: DLL load failed: The specified procedure could not be found.如何解决这个导入错误?少了什么?
发布于 2014-10-18 05:44:54
当您同时安装了一个遗留版本和一个新版本的python时,就会出现这种症状。我建议您完全卸载并使用pip安装python。一般来说,我建议不再使用easy_install。
遗留版本(v0.2.x)具有安装包名称“docx”。新版本使用的名称是‘python’(虽然这两个导入都是“docx”,但一旦安装就可以了)。如果安装时使用pip进行卸载/重新安装,则如下所示:
$ pip freeze
...
docx
...
python-docx
...
$ pip uninstall docx
...
$ pip uninstall python-docx
...
$ pip install python-docx
...听起来您最初使用的是easy_install,所以您可能需要手动卸载,不过我会先试一试,看看pip是否会帮您完成。如果不是,快速搜索python easy_install uninstall将引导您找到有用的资源。它可能包括访问“c:\python 26\lib\site-packages”,并删除以'docx‘或’python‘开头的任何文件或目录。
这应该能让你走得更远。如果这样做还会给你带来麻烦的话,让我知道新的症状。如果使用pip,您应该能够非常透明地安装在未损坏的Python安装上。
发布于 2017-07-04 13:19:24
我也得到了同样的'DLL加载失败‘错误。我犯了一个愚蠢的错误,但在64位Windows上安装了32位Python。未安装32位版本,安装64位版本-问题排序.
https://stackoverflow.com/questions/26404228
复制相似问题