python查看包版本、更新单个包、卸载单个包

2022-12-31 10:39:50

python查看包版本、更新单个包、卸载单个包

查看python某个包的版本?

pip freeze | grep xxx

pip show xxx 

更新单个包

使用 pip 一次性更新所有 Python 软件包并不是一个好主意。我发现一次性更新后,软件包之间的依赖关系被破坏了,所以请确保只更新你想要更新的软件包。

更新单个包,如celery

pip install -U celery

pip install --upgrade  celery

-U:升级 原来已经安装的包,不带U不会装新版本,带上U才会更新到最新版本

-i: 指定库的安装源 清华源

pip install pyyaml -i https://pypi.tuna.tsinghua.edu.cn/simple

卸载某个包

卸载某个包,如numpy

pip uninstall numpy
  • 作者:西京刀客
  • 原文链接:https://blog.csdn.net/inthat/article/details/128131992
    更新时间:2022-12-31 10:39:50