Python Forum
How do I install the dom.minidom module? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: How do I install the dom.minidom module? (/thread-25955.html)



How do I install the dom.minidom module? - Johno - Apr-16-2020

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.


RE: How do I install the dom.minidom module? - Larz60+ - Apr-17-2020

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.dom.minidom.html
this is not in package py-xml, so remove import


RE: How do I install the dom.minidom module? - Johno - Apr-17-2020

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"


RE: How do I install the dom.minidom module? - Larz60+ - Apr-17-2020

not that one, the xml one.
look at the links provided