Find python lxml version

前端 未结 6 1618
Happy的楠姐
Happy的楠姐 2021-02-03 18:32

How can I find the installed python-lxml version in a Linux system?

>>> import lxml
>>> lxml.__version__
Traceback (most recent call last):
  F         


        
6条回答
  •  情歌与酒
    2021-02-03 18:50

    You can get the version by looking at etree:

    >>> from lxml import etree
    >>> etree.LXML_VERSION
    (3, 0, -198, 0)
    

    Other versions of interest can be: etree.LIBXML_VERSION, etree.LIBXML_COMPILED_VERSION, etree.LIBXSLT_VERSION and etree.LIBXSLT_COMPILED_VERSION.

提交回复
热议问题