Linux command
pip-uninstall 命令
网络
复制后可按需替换文件名、目录或参数。
常用示例
Uninstall a package
pip uninstall [package]
Uninstall without confirmation prompt
pip uninstall -y [package]
Uninstall multiple packages
pip uninstall [package1] [package2]
Uninstall every package
pip uninstall -r [requirements.txt]
Uninstall and auto-confirm
pip uninstall -y -r [requirements.txt]
说明
pip uninstall removes installed Python packages. It prompts for confirmation before removing each package unless `-y` is used. Pip removes the package files, entry-point scripts, and metadata, but does not automatically remove dependencies that were installed alongside the package. Packages installed in "editable" mode (`pip install -e`) and those installed directly from VCS URLs can also be removed by name. Packages installed by the system package manager (e.g., `apt`, `dnf`) or those installed without using pip's metadata cannot be uninstalled by pip.
参数
- -r _FILE_, --requirement _FILE_
- Uninstall all packages listed in the given requirements file. May be used multiple times.
- -y, --yes
- Don't ask for confirmation of uninstall deletions.
- --root-user-action _ACTION_
- Action when pip is run as root (warn, ignore).
- --no-input
- Disable prompting for input.
- -v, --verbose
- Give more output. Repeatable.
- -q, --quiet
- Give less output.
FAQ
What is the pip-uninstall command used for?
pip uninstall removes installed Python packages. It prompts for confirmation before removing each package unless `-y` is used. Pip removes the package files, entry-point scripts, and metadata, but does not automatically remove dependencies that were installed alongside the package. Packages installed in "editable" mode (`pip install -e`) and those installed directly from VCS URLs can also be removed by name. Packages installed by the system package manager (e.g., `apt`, `dnf`) or those installed without using pip's metadata cannot be uninstalled by pip.
How do I run a basic pip-uninstall example?
Run `pip uninstall [package]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -r _FILE_, --requirement _FILE_ do in pip-uninstall?
Uninstall all packages listed in the given requirements file. May be used multiple times.