pip基本命令

  1. Install a Package:

    • Command: pip install package_name
    • Usage: Installs the specified package. You can also specify a version number with package_name==version_number.
  2. Install Packages from a Requirements File:

    • Command: pip install -r requirements.txt
    • Usage: Installs all the packages listed in the specified requirements file (requirements.txt is a common filename).
  3. Upgrade a Package:

    • Command: pip install --upgrade package_name
    • Usage: Upgrades the specified package to the latest version.
  4. Uninstall a Package:

    • Command: pip uninstall package_name
    • Usage: Uninstalls the specified package from the environment.
  5. List Installed Packages:

    • Command: pip list
    • Usage: Lists all packages installed in the current environment along with their versions.
  6. Show Information about a Package:

    • Command: pip show package_name
    • Usage: Displays detailed information about a specific package, including its version, dependencies, and location.
  7. Search for a Package:

    • Command: pip search search_term
    • Usage: Searches the Python Package Index (PyPI) for packages whose name or summary contains the search term.
  8. Freeze Installed Packages:

    • Command: pip freeze
    • Usage: Outputs a list of all installed packages in a requirements format. Often used to create a requirements.txt file.
  9. Check for Packages with Known Issues:

    • Command: pip check
    • Usage: Checks for installed packages with known issues, such as broken dependencies.
  10. Download a Package:

    • Command: pip download package_name
    • Usage: Downloads a package and its dependencies but does not install them.
  11. Install a Package at a Specific Version:

    • Command: pip install package_name==version_number
    • Usage: Installs a specific version of a package.
  12. Upgrade pip Itself:

    • Command: pip install --upgrade pip
    • Usage: Upgrades pip to the latest version.
posted @   马路野狼  阅读(12)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· DeepSeek在M芯片Mac上本地化部署
点击右上角即可分享
微信分享提示
主题色彩