网站首页 > 技术文章 正文
usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Options (and corresponding environment variables):
-b : issue warnings about converting bytes/bytearray to str and comparing
bytes/bytearray with str or bytes with int. (-bb: issue errors)
-B : don't write .pyc files on import; also PYTHONDONTWRITEBYTECODE=x
-c cmd : program passed in as string (terminates option list)
-d : turn on parser debugging output (for experts only, only works on
debug builds); also PYTHONDEBUG=x
-E : ignore PYTHON* environment variables (such as PYTHONPATH)
-h : print this help message and exit (also -? or --help)
-i : inspect interactively after running script; forces a prompt even
if stdin does not appear to be a terminal; also PYTHONINSPECT=x
-I : isolate Python from the user's environment (implies -E and -s)
-m mod : run library module as a script (terminates option list)
-O : remove assert and __debug__-dependent statements; add .opt-1 before
.pyc extension; also PYTHONOPTIMIZE=x
-OO : do -O changes and also discard docstrings; add .opt-2 before
.pyc extension
-P : don't prepend a potentially unsafe path to sys.path; also
PYTHONSAFEPATH
-q : don't print version and copyright messages on interactive startup
-s : don't add user site directory to sys.path; also PYTHONNOUSERSITE=x
-S : don't imply 'import site' on initialization
-u : force the stdout and stderr streams to be unbuffered;
this option has no effect on stdin; also PYTHONUNBUFFERED=x
-v : verbose (trace import statements); also PYTHONVERBOSE=x
can be supplied multiple times to increase verbosity
-V : print the Python version number and exit (also --version)
when given twice, print more information about the build
-W arg : warning control; arg is action:message:category:module:lineno
also PYTHONWARNINGS=arg
-x : skip first line of source, allowing use of non-Unix forms of #!cmd
-X opt : set implementation-specific option
--check-hash-based-pycs always|default|never:
control how Python invalidates hash-based .pyc files
--help-env: print help about Python environment variables and exit
--help-xoptions: print help about implementation-specific -X options and exit
--help-all: print complete help information and exit
Arguments:
file : program read from script file
- : program read from stdin (default; interactive mode if a tty)
arg ...: arguments passed to program in sys.argv[1:]
Usage:
pip <command> [options]
Commands:
install Install packages.
lock Generate a lock file.
download Download packages.
uninstall Uninstall packages.
freeze Output installed packages in requirements format.
inspect Inspect the python environment.
list List installed packages.
show Show information about installed packages.
check Verify installed packages have compatible dependencies.
config Manage local and global configuration.
search Search PyPI for packages.
cache Inspect and manage pip's wheel cache.
index Inspect information available from package indexes.
wheel Build wheels from your requirements.
hash Compute hashes of package archives.
completion A helper command used for command completion.
debug Show information useful for debugging.
help Show help for commands.
General Options:
-h, --help Show help.
--debug Let unhandled exceptions propagate outside the
main subroutine, instead of logging them to
stderr.
--isolated Run pip in an isolated mode, ignoring
environment variables and user configuration.
--require-virtualenv Allow pip to only run in a virtual environment;
exit with an error otherwise.
--python <python> Run pip with the specified Python interpreter.
-v, --verbose Give more output. Option is additive, and can be
used up to 3 times.
-V, --version Show version and exit.
-q, --quiet Give less output. Option is additive, and can be
used up to 3 times (corresponding to WARNING,
ERROR, and CRITICAL logging levels).
--log <path> Path to a verbose appending log.
--no-input Disable prompting for input.
--keyring-provider <keyring_provider>
Enable the credential lookup via the keyring
library if user input is allowed. Specify which
mechanism to use [auto, disabled, import,
subprocess]. (default: auto)
--proxy <proxy> Specify a proxy in the form
scheme://[user:passwd@]proxy.server:port.
--retries <retries> Maximum attempts to establish a new HTTP
connection. (default: 5)
--timeout <sec> Set the socket timeout (default 15 seconds).
--exists-action <action> Default action when a path already exists:
(s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.
--trusted-host <hostname> Mark this host or host:port pair as trusted,
even though it does not have valid or any HTTPS.
--cert <path> Path to PEM-encoded CA certificate bundle. If
provided, overrides the default. See 'SSL
Certificate Verification' in pip documentation
for more information.
--client-cert <path> Path to SSL client certificate, a single file
containing the private key and the certificate
in PEM format.
--cache-dir <dir> Store the cache data in <dir>.
--no-cache-dir Disable the cache.
--disable-pip-version-check
Don't periodically check PyPI to determine
whether a new version of pip is available for
download. Implied with --no-index.
--no-color Suppress colored output.
--use-feature <feature> Enable new functionality, that may be backward
incompatible.
--use-deprecated <feature> Enable deprecated functionality, that will be
removed in the future.
--resume-retries <resume_retries>
Maximum attempts to resume or restart an
incomplete download. (default: 0)
猜你喜欢
- 2025-06-30 如何利用企业微信做一个免费发送微信消息的站点
- 2025-06-30 linux下远程管理命令-关机与重启(linux远程主机关闭连接)
- 2025-06-30 一款构建Python命令行应用的开源库
- 2025-06-30 如何阻止输入 Python 命令时打开 Microsoft 商店?
- 2025-06-30 Python中subprocess模块:轻松调用外部程序与命令
- 2025-06-30 Python 的退出命令:quit()、exit()、sys.exit() 和 os._exit()
- 2025-06-30 Argparse:一个具体案例教会你python命令行参数解析
- 2025-06-30 实现Python命令行操作的基本步骤(python在命令行下编写代码)
- 2025-06-30 Java & Python 康威生命游戏 - 命令行版
- 2025-06-30 分享7个 Python CLI 库,助您快速构建高效命令行应用程序
- 277℃Python短文,Python中的嵌套条件语句(六)
- 276℃python笔记:for循环嵌套。end=""的作用,图形打印
- 273℃PythonNet:实现Python与.Net代码相互调用!
- 268℃Python实现字符串小写转大写并写入文件
- 267℃Python操作Sqlserver数据库(多库同时异步执行:增删改查)
- 126℃原来2025是完美的平方年,一起探索六种平方的算吧
- 110℃Ollama v0.4.5-v0.4.7 更新集合:Ollama Python 库改进、新模型支持
- 108℃Python 和 JavaScript 终于联姻了!PythonMonkey 要火?
- 最近发表
-
- 假期苦短,我用Python!这有个自动回复拜年信息的小程序
- 第4天|16天搞定Python数据分析,图表,靓靓靓
- 60带源代码的Python项目之 08 使用 Python 生成 QR 码
- 用python3 实现生成二维码代码示例
- python批量生成二维码图片(python如何生成二维码)
- 使用python生成二维码(python生成二维码界面)
- Python制作二维码(python制作二维码小作业)
- Python 生成条形码、二维码 (Code 128、EAN-13、QR code等)
- python如何实现二维码的生成和识别
- Python 使用 JsonPath 完成接口自动化测试中参数关联和数据验证
- 标签列表
-
- python中类 (31)
- python 迭代 (34)
- python 小写 (35)
- python怎么输出 (33)
- python 日志 (35)
- python语音 (31)
- python 工程师 (34)
- python3 安装 (31)
- python音乐 (31)
- 安卓 python (32)
- python 小游戏 (32)
- python 安卓 (31)
- python聚类 (34)
- python向量 (31)
- python大全 (31)
- python次方 (33)
- python桌面 (32)
- python总结 (34)
- python浏览器 (32)
- python 请求 (32)
- python 前端 (32)
- python验证码 (33)
- python 题目 (32)
- python 文件写 (33)
- python中的用法 (32)