pip uninstall #

用法 #

python -m pip uninstall [options] <package> ...
python -m pip uninstall [options] -r <requirements file> ...
					
py -m pip uninstall [options] <package> ...
py -m pip uninstall [options] -r <requirements file> ...
					

描述 #

Uninstall packages.

pip is able to uninstall most installed packages. Known exceptions are:

  • Pure distutils packages installed with python setup.py install , which leave behind no metadata to determine what files were installed.

  • Script wrappers installed by python setup.py develop .

选项 #

-r , --requirement <file> #

Uninstall all the packages listed in the given requirements file. This option can be used multiple times.

-y , --yes #

Don’t ask for confirmation of uninstall deletions.

--root-user-action <root_user_action> #

Action if pip is run as a root user. By default, a warning message is shown.

范例 #

  1. Uninstall a package.

    $ python -m pip uninstall simplejson
    Uninstalling simplejson:
       /home/me/env/lib/python3.9/site-packages/simplejson
       /home/me/env/lib/python3.9/site-packages/simplejson-2.2.1-py3.9.egg-info
    Proceed (Y/n)? y
       Successfully uninstalled simplejson
    							
    C:\> py -m pip uninstall simplejson
    Uninstalling simplejson:
       /home/me/env/lib/python3.9/site-packages/simplejson
       /home/me/env/lib/python3.9/site-packages/simplejson-2.2.1-py3.9.egg-info
    Proceed (Y/n)? y
       Successfully uninstalled simplejson
    							

内容