簡體   English   中英

導入 pptx 時出錯“導入錯誤:DLL 加載失敗:找不到指定的過程。”

[英]Error when Import pptx "ImportError: DLL load failed: The specified procedure could not be found."

我有一個與此線程非常相似的問題,但是該解決方案並未解決我的問題。 我不斷收到此錯誤。

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.

在我最初安裝 python-pptx 時,我使用了:

pip install python-pptx

這並不像OP所說的那樣在他的職位上為他工作。 我已經使用 pip uninstall 並重新安裝,並得到同樣的錯誤。 我還嘗試再次安裝並獲得:

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 將更新

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 /

但我仍然收到錯誤消息。 當我運行 pip install lxml 時,我得到:

Requirement already satisfied: lxml in c:\program files\anaconda3\lib\site-packages (4.4.2)

所以我現在完全不知道該怎么做才能讓它發揮作用。 任何幫助深表感謝! 蒂亞!

更新:我卸載了python-pptx ,然后是lxml ,然后只是pip install python-pptx ,我認為它可能正在工作。

通過 pip install --upgrade lxml 將 lxml 升級到最新版本對我有用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM