Python Forum

Full Version: How do I install the dom.minidom module?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am using SUSE Linux. I ran this:
sudo pip install py-xml

I am trying to debug a Python program. I run this command from a Python prompt:

>>> from xml.dom.minidom import parse

I see this:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named dom.minidom


I ran this: sudo zypper -n install python-libxml2

I tried cloning https://github.com/JeremyDemers/py-xml. I ran python setup.py build and python setup.py install. I do not know how to get the dom.minidom module installed. How do I get it installed so that I may use >>> from xml.dom.minidom import parse

I am able to use that Python interpreter command on non-SUSE servers.
Quote:Python.org Warning
The xml.dom.minidom module is not secure against maliciously constructed data. If you need to parse untrusted or unauthenticated data see XML vulnerabilities.

usage: https://docs.python.org/3.8/library/xml....nidom.html
this is not in package py-xml, so remove import
For my own situation I cannot remove the "import parse". The link you sent has the "import parse" statement. I see "from xml.dom.minidom import parse, parseString"
not that one, the xml one.
look at the links provided