Find which version of package is installed with pip

前端 未结 15 2150
死守一世寂寞
死守一世寂寞 2020-12-04 04:43

Using pip, is it possible to figure out which version of a package is currently installed?

I know about pip install XYZ --upgrade but I am wondering if

15条回答
  •  星月不相逢
    2020-12-04 05:22

    As of pip 1.3, there is a pip show command.

    $ pip show Jinja2
    ---
    Name: Jinja2
    Version: 2.7.3
    Location: /path/to/virtualenv/lib/python2.7/site-packages
    Requires: markupsafe
    

    In older versions, pip freeze and grep should do the job nicely.

    $ pip freeze | grep Jinja2
    Jinja2==2.7.3
    

提交回复
热议问题