Find python lxml version

前端 未结 6 1619
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:46

    Here are two more ways to do it, with minimal typing. You could do it with pip from the command line:

    $ pip freeze | grep lxml
    lxml==3.2.5
    

    Since you installed from ubuntu repository with apt-get you can also use dpkg:

    $ dpkg -l python-lxml
    Desired=Unknown/Install/Remove/Purge/Hold
    | Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
    |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
    ||/ Name                     Version                  Description
    +++-========================-========================-================================================================
    ii  python-lxml              2.2.4-1                  pythonic binding for the libxml2 and libxslt libraries
    

提交回复
热议问题