用pip查找安装了哪个版本的包 [英] Find which version of package is installed with pip

查看:46
本文介绍了用pip查找安装了哪个版本的包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 pip,是否可以确定当前安装的是哪个版本的软件包?

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

我知道 pip install XYZ --upgrade 但我想知道是否有类似 pip info XYZ 的东西.如果不是,最好的方法是告诉我当前使用的是哪个版本.

I know about pip install XYZ --upgrade but I am wondering if there is anything like pip info XYZ. If not what would be the best way to tell what version I am currently using.

推荐答案

As of pip 1.3,有一个 pip show 命令.

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

在旧版本中,pip freezegrep 应该可以很好地完成这项工作.

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

$ pip freeze | grep Jinja2
Jinja2==2.7.3

这篇关于用pip查找安装了哪个版本的包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆