[英]Error when Import pptx "ImportError: DLL load failed: The specified procedure could not be found."
I have a very similar issue to this thread however the solution is not fixing my issue.我有一个与此线程非常相似的问题,但是该解决方案并未解决我的问题。 I keep getting this error.我不断收到此错误。
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Program Files\Anaconda3\lib\site-packages\pptx\__init__.py", line 14, in <module>
from pptx.api import Presentation # noqa
File "C:\Program Files\Anaconda3\lib\site-packages\pptx\api.py", line 15, in <module>
from .package import Package
File "C:\Program Files\Anaconda3\lib\site-packages\pptx\package.py", line 11, in <module>
from .opc.package import OpcPackage
File "C:\Program Files\Anaconda3\lib\site-packages\pptx\opc\package.py", line 13, in <module>
from .oxml import CT_Relationships, serialize_part_xml
File "C:\Program Files\Anaconda3\lib\site-packages\pptx\opc\oxml.py", line 12, in <module>
from lxml import etree
ImportError: DLL load failed: The specified procedure could not be found.
On my initial install of python-pptx I used:在我最初安装 python-pptx 时,我使用了:
pip install python-pptx
which is not working as the OP said was working for him in his post.这并不像OP所说的那样在他的职位上为他工作。 I have used pip uninstall and reinstalled, and get the same error.我已经使用 pip uninstall 并重新安装,并得到同样的错误。 I also tried to just install again and get:我还尝试再次安装并获得:
Looking in indexes: website name was here
Requirement already satisfied: python-pptx in c:\program files\anaconda3\lib\site-packages (0.6.18)
Requirement already satisfied: lxml>=3.1.0 in c:\program files\anaconda3\lib\site-packages (from python-pptx) (4.4.2)
Requirement already satisfied: Pillow>=3.3.2 in c:\program files\anaconda3\lib\site-packages (from python-pptx) (6.2.1)
Requirement already satisfied: XlsxWriter>=0.5.7 in c:\program files\anaconda3\lib\site-packages (from python-pptx) (1.1.2)
conda install lxml will update conda install lxml 将更新
ca-certificates: 2018.03.07-0 https://repo.anaconda.com/pkgs/main --> 2019.11.27-0 /
certifi: 2018.11.29-py37_0 https://repo.anaconda.com/pkgs/main --> 2019.11.28-py37_0 /
conda: 4.5.12-py37_0 https://repo.anaconda.com/pkgs/main --> 4.7.12-py37_0 /
libxml2: 2.9.8-hadb2253_1 https://repo.anaconda.com/pkgs/main --> 2.9.9-h464c3ec_0 /
libxslt: 1.1.32-hf6f1972_0 https://repo.anaconda.com/pkgs/main --> 1.1.33-h579f668_0 /
lxml: 4.2.5-py37hef2cd61_0 https://repo.anaconda.com/pkgs/main --> 4.4.2-py37h1350720_0 /
openssl: 1.1.1a-he774522_0 https://repo.anaconda.com/pkgs/main --> 1.1.1d-he774522_3 /
qt: 5.9.7-vc14h73c81de_0 https://repo.anaconda.com/pkgs/main [vc14] --> 5.9.7-vc14h73c81de_0 /
vc: 14.1-h0510ff6_4 https://repo.anaconda.com/pkgs/main --> 14.1-h0510ff6_4 /
vs2015_runtime: 14.15.26706-h3a45250_0 https://repo.anaconda.com/pkgs/main --> 14.16.27012-hf0eaf9b_0 /
but I still get an error.但我仍然收到错误消息。 When I run pip install lxml I get:当我运行 pip install lxml 时,我得到:
Requirement already satisfied: lxml in c:\program files\anaconda3\lib\site-packages (4.4.2)
So I'm completely lost right now about what to do to get this to work.所以我现在完全不知道该怎么做才能让它发挥作用。 Any help is much appreciated!任何帮助深表感谢! TIA!蒂亚!
UPDATE: I uninstalled python-pptx
and then lxml
and then just did pip install python-pptx
and I think it may be working.更新:我卸载了python-pptx
,然后是lxml
,然后只是pip install python-pptx
,我认为它可能正在工作。
通过 pip install --upgrade lxml 将 lxml 升级到最新版本对我有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.