简介
pip是Python有它自己的包管理工具,与yum和apt-get相似。
安装步骤:
1、下载get-pip.py:https://bootstrap.pypa.io/get-pip.py
2、以root用户运行命令:python get-pip.py,即可完成安装。
使用详解
1、pip安装软件
# pip install SomePackage [...] Successfully installed SomePackage
2、pip查看已安装的软件
# pip show --files SomePackage Name: SomePackage Version: 1.0 Location: /my/env/lib/pythonx.x/site-packages Files: ../somepackage/__init__.py [...]
3、pip检查哪些软件需要更新
# pip list --outdated SomePackage (Current: 1.0 Latest: 2.0)
4、pip升级软件
# pip install --upgrade SomePackage [...] Found existing installation: SomePackage 1.0 Uninstalling SomePackage: Successfully uninstalled SomePackage Running setup.py install for SomePackage Successfully installed SomePackage
5、pip卸载软件
$ pip uninstall SomePackage Uninstalling SomePackage: /my/env/lib/pythonx.x/site-packages/somepackage Proceed (y/n)? y Successfully uninstalled SomePackage
使用实例
安装flask
常见错误解决
参考《ImportError No module named setuptools解决》
时间: 2024-10-08 09:06:40