查找python lxml版本 [英] Find python lxml version
本文介绍了查找python lxml版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在Linux系统中找到已安装的python-lxml版本?
How can I find the installed python-lxml version in a Linux system?
>>> import lxml
>>> lxml.__version__
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute '__version__'
>>> from pprint import pprint
>>> pprint(dir(lxml))
['__builtins__',
'__doc__',
'__file__',
'__name__',
'__package__',
'__path__',
'get_include',
'os']
>>>
似乎找不到它
推荐答案
您可以通过查看etree
来获取版本:
You can get the version by looking at etree
:
>>> from lxml import etree
>>> etree.LXML_VERSION
(3, 0, -198, 0)
其他感兴趣的版本可以是:etree.LIBXML_VERSION
,etree.LIBXML_COMPILED_VERSION
,etree.LIBXSLT_VERSION
和etree.LIBXSLT_COMPILED_VERSION
.
Other versions of interest can be: etree.LIBXML_VERSION
, etree.LIBXML_COMPILED_VERSION
, etree.LIBXSLT_VERSION
and etree.LIBXSLT_COMPILED_VERSION
.
这篇关于查找python lxml版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文