Find which version of package is installed with pip

前端 未结 15 2080
死守一世寂寞
死守一世寂寞 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:01

    In question, it is not mentioned which OS user is using (Windows/Linux/Mac)

    As there are couple of answers which will work flawlessly on Mac and Linux.

    Below command can be used in case the user is trying to find the version of a python package on windows.

    In PowerShell use below command :

    pip list | findstr <PackageName>

    Example:- pip list | findstr requests

    Output : requests 2.18.4

    0 讨论(0)
  • 2020-12-04 05:04

    For Windows you can

    1. open cmd and type python, press enter.

    2. type the import and press enter.

    3. type ._version__ and press enter.

    As you can see in screen shot here I am using this method for checking the version of serial module.

    Image


    0 讨论(0)
  • 2020-12-04 05:07

    pip show works in python 3.7:

    pip show selenium
    Name: selenium
    Version: 4.0.0a3
    Summary: Python bindings for Selenium
    Home-page: https://github.com/SeleniumHQ/selenium/
    Author: UNKNOWN
    Author-email: UNKNOWN
    License: Apache 2.0
    Location: c:\python3.7\lib\site-packages\selenium-4.0.0a3-py3.7.egg
    Requires: urllib3
    Required-by:
    
    0 讨论(0)
  • 2020-12-04 05:09

    There's also a tool called pip-check which gives you a quick overview of all installed packages and their update status:

    Haven't used it myself; just stumbled upon it and this SO question in quick succession, and since it wasn't mentioned...

    0 讨论(0)
  • 2020-12-04 05:11

    I just sent a pull request in pip with the enhancement Hugo Tavares said:

    (specloud as example)

    $ pip show specloud
    
    Package: specloud
    Version: 0.4.4
    Requires:
    nose
    figleaf
    pinocchio
    
    0 讨论(0)
  • 2020-12-04 05:12

    On windows, you can issue command such as:

    pip show setuptools | findstr "Version"
    

    Output:

    Version: 34.1.1
    
    0 讨论(0)
提交回复
热议问题