为什么'pip show'或'pip list'对我不起作用?

9 浏览
0 Comments

为什么'pip show'或'pip list'对我不起作用?

Python的pip对于我来说可以用来安装和更新包,但是一些文档中的命令似乎不被支持(至少在OS 10.8.2和Python 2.7.2上使用1.2.1版本时如此)。当我尝试使用

pip list

或者

pip show 

我得到的结果是

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

这些命令还没有实现吗(尽管已经在文档中记录了)?

admin 更改状态以发布 2023年5月23日
0
0 Comments

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

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              Log file where a complete (maximum verbosity) record will be kept
 --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           Set the socket timeout (default 15 seconds)
 --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

0
0 Comments

你要寻找的新功能非常近期出现--它们在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

0