0
Ich habe es geschafft, python-pptx 0.6.5 mit 'pip install python-pptx' zu installieren, aber wenn ich "von pptx Präsentation importieren", es gemeldet Fehler. Kann mir bitte jemand helfen? Fehlerbericht ist unter:Warum konnte ich Pptx-Paket in Python 3.5 nicht importieren
Traceback (most recent call last):
File "Course_1.py", line 1, in <module>
from pptx import Presentation
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pptx/__init__.py", line 15, in <module>
from pptx.api import Presentation # noqa
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pptx/api.py", line 17, in <module>
from .package import Package
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pptx/package.py", line 13, in <module>
from .opc.package import OpcPackage
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pptx/opc/package.py", line 13, in <module>
from .oxml import CT_Relationships, serialize_part_xml
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pptx/opc/oxml.py", line 12, in <module>
from lxml import etree
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/lxml/etree.cpython-35m-darwin.so, 2): Library not loaded: libxml2.2.dylib
Referenced from: /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/lxml/etree.cpython-35m-darwin.so
Reason: Incompatible library version: etree.cpython-35m-darwin.so requires version 12.0.0 or later, but libxml2.2.dylib provides version 10.0.0
Das ist nicht das Problem. Es war nur ein Tippfehler in der Frage. Der Stack-Trace wäre völlig anders, wenn der Code wirklich so wäre. –