Python pip命令查看已安装的库版本

以使用pip的”show”命令来查看已安装的Python包的版本,具体的命令如下:

pip show langchain

执行结果如下:

(langchain) 192:langchain zzs$ pip show langchain
Name: langchain
Version: 0.1.4
Summary: Building applications with LLMs through composability
Home-page: https://github.com/langchain-ai/langchain
Author: 
Author-email: 
License: MIT
Location: /Users/zzs/develop/projects/langchain/lib/python3.11/site-packages
Requires: aiohttp, dataclasses-json, jsonpatch, langchain-community, langchain-core, langsmith, numpy, pydantic, PyYAML, requests, SQLAlchemy, tenacity
Required-by: 

这会返回langchain的版本号,安装路径等信息。

pip命令查看远程仓库中的版本

如果你要查看远程仓库中openAI的版本,可以使用pip search命令,如下所示:

pip search openai

然而,pip search命令已在pip的最新版本中移除。如果你想查看远程仓库中的openAI的所有版本,你可以查看PyPI网站,地址如下:

https://pypi.org/project/openai/#history

此外,你还可以为pip安装yolk3k工具,这是一个轻量级的Python工具,可以从PyPI中检索包信息,包括版本信息,如下所示:

pip install yolk3k
yolk -V openai
这将会列出在PyPI中发布的openai的所有版本。

pip官网查看

访问:https://pypi.org/

在输入框中输入对应的库,比如LangChain,即可查看搜索到版本信息。

找对对应的版本信息,则可以通过pip命令进行安装或配置到requirements文件中。



Python查看库版本的几种情况插图

关注公众号:程序新视界,一个让你软实力、硬技术同步提升的平台

除非注明,否则均为程序新视界原创文章,转载必须以链接形式标明本文链接

本文链接:http://folen.top/2024/01/27/python-pip-version/