Wolfram Research

Function Repository Resource:

PythonPackageUninstall

Source Notebook

Uninstall a Python package

Contributed by: Wolfram Staff

ResourceFunction["PythonPackageUninstall"]["pkg"]

uninstalls the Python package "pkg".

ResourceFunction["PythonPackageUninstall"][{"pkg1","pkg2",}]

uninstalls the specified packages.

ResourceFunction["PythonPackageUninstall"][python,"pkg"]

uninstalls for the given Python installation.

Details and Options

ResourceFunction["PythonPackageUninstall"]["pkg"] attempts to uninstall the specified package, returning Success or Failure.
In ResourceFunction["PythonPackageUninstall"]["pkg"], pkg can be a package name or the object Success["PythonPackageInstalled",] returned by PythonPackageInstall.
ResourceFunction["PythonPackageUninstall"][Success["PythonPackageInstalled",]] uninstalls the package with its dependencies.
ResourceFunction["PythonPackageUninstall"][Success["PythonPackageAlreadyInstalled",]] uninstalls only the package referenced in the Success object returned by PythonPackageInstall.
ResourceFunction["PythonPackageUninstall"][name] is effectively equivalent to executing the command line pip uninstall name.

Examples

Basic Examples

Install and then uninstall a Python package without dependencies:

In[1]:=
ResourceFunction["PythonPackageInstall"]["tornado"]
Out[1]=
In[2]:=
ResourceFunction["PythonPackageUninstall"]["tornado"]
Out[2]=

Install and uninstall several packages:

In[3]:=
ResourceFunction["PythonPackageInstall"][{"tornado", "camelcase"}]
Out[3]=
In[4]:=
ResourceFunction["PythonPackageUninstall"][%]
Out[4]=

Install and uninstall a Python package with dependencies:

In[5]:=
ResourceFunction["PythonPackageInstall"]["tst"]
Out[5]=
In[6]:=
ResourceFunction["PythonPackageUninstall"][%]
Out[6]=

Resource History

Source Metadata

Related Resources

License Information