I can't import xml.dom.minidom in PyCharm. What could I Try?

前端 未结 2 1327
醉梦人生
醉梦人生 2021-01-18 17:46

I\'m trying to import xml.dom.minidom but pycharm doesn\'t find it, altough it finds xml.entree / xml.parser / xml.sax.

The rest of the standart libraries work all f

相关标签:
2条回答
  • 2021-01-18 17:47

    I faced the same problem after upgrading to 2020.1. The problem is already reported in the Pycharm issue tracker.

    There they propose the following workaround until the issue is fixed:

    Replace xml directory in <INSTALLATION_FOLDER>\plugins\python(-ce)\helpers\typeshed\stdlib\2and3\ with xml from https://github.com/python/typeshed/tree/master/stdlib/2and3/xml

    On my machine this solved the problem.

    0 讨论(0)
  • 2021-01-18 17:53

    My recommendation is to just put the following around the imports until Pycharm fixes the bug.

    # noinspection PyUnresolvedReferences
    from xml.dom.minidom import Document
    # noinspection PyUnresolvedReferences
    from xml.dom.minidom import Element
    
    0 讨论(0)
提交回复
热议问题