【问题标题】:Why don't 'pip show' or 'pip list' work for me?为什么“点子秀”或“点子列表”对我不起作用?
【发布时间】:2012-12-13 03:50:27
【问题描述】:

Python 的 pip 正在帮助我安装和更新软件包,但似乎不支持某些记录在案的命令(至少在 OS 10.8.2 和 Python 2.7.2 上运行的 1.2.1 是这样)。当我尝试

pip list

或

pip show <pkgname>

我明白了

Usage: pip COMMAND [OPTIONS]
No command by the name pip <cmd>
  (maybe you meant "pip install <cmd>")

这些命令是否尚未实现(尽管已记录在案)?

【问题讨论】:

    标签: python macos pip


    【解决方案1】:

    作为一种解决方法,您可以使用pip freeze。

    从帮助提示:

    freeze: Output all currently installed packages (exact versions) to stdout
    

    【讨论】:

      【解决方案2】:

      您正在寻找的新功能是最新的——它们在 1.2.1.post1 中,但不在 1.2.1 中,而且您可能正在查看的文档 (http://www.pip -installer.org/en/latest/) 目前适用于 1.2.1.post1。

      localhost-2:~ $ pip --version
      pip 1.2.1.post1 from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.2.1.post1-py2.7.egg (python 2.7)
      localhost-2:~ $ pip --help
      Usage: pip COMMAND [OPTIONS]
      
      Commands:
        bundle               Create pybundles (archives containing multiple packages)
        freeze               Output all currently installed packages (exact versions) to stdout
        help                 Show available commands
        install              Install packages
        list                 List installed packages (including editables).
        search               Search PyPI
        show                 Output installed distributions (exact versions, files) to stdout
        uninstall            Uninstall packages
        unzip                Unzip individual packages
        zip                  Zip individual packages
      

      如果你想要它们,你可以得到开发版本:

      git clone https://github.com/pypa/pip.git
      

      【讨论】:

      • 如果pip show 说summary: unknown,我如何获取信息?例如command-not-found 包。
      【解决方案3】:

      从 pip 1.1 开始可用的命令是:

      • bundle:创建 pybundles(包含多个包的存档)
      • 冻结:将所有当前安装的包(精确版本)输出到标准输出
      • 帮助:显示可用命令
      • 安装:安装软件包
      • 搜索:搜索 PyPI
      • 卸载:卸载软件包
      • 解压缩:解压缩单个包
      • zip:压缩单个包

      有关已安装软件包的列表,请尝试yolk。

      【讨论】:

        【解决方案4】:

        它们在哪里记录?我的没有显示任何这样的命令:

        hd1 % pip help
        Usage: pip COMMAND [OPTIONS]
         --version                    show program's version number and exit
         -h, --help                   Show help
         -v, --verbose                Give more output
         -q, --quiet                  Give less output
         --log <FILENAME>             Log file where a complete (maximum verbosity) record will be kept
         --proxy <PROXY>              Specify a proxy in the form user:passwd@proxy.server:port. Note that the user:password@ is optional and required only if you are behind an authenticated proxy. If you provide
                                      user@proxy.server:port then you will be prompted for a password.
         --timeout <SECONDS>          Set the socket timeout (default 15 seconds)
         --exists-action <EXISTS_ACTION>
                                      Default action when a path already exists. Use this option more than one time to specify another action if a certain option is not available. Choices: (s)witch, (i)gnore,
                                      (w)ipe, (b)ackup
        
        Commands available:
          bundle: Create pybundles (archives containing multiple packages)
          freeze: Output all currently installed packages (exact versions) to stdout
          help: Show available commands
          install: Install packages
          search: Search PyPI
          uninstall: Uninstall packages
          unzip: Unzip individual packages
          zip: Zip individual packages
        

        【讨论】:

        猜你喜欢
        • 2019-01-15
        • 2021-12-20
        • 1970-01-01
        • 2019-06-25
        • 2010-12-17
        • 1970-01-01
        • 2014-01-18
        • 1970-01-01
        • 2010-09-09
        相关资源
        最近更新 更多