Installing a package (“package_name
”) using the State Tool can be done using the following syntax to:
The following syntax will install a specific version of the package (package_name
) to your project.
state install <package_name@version_number>
For example
state install requests@2.31.0
You can select or exclude specific versions of the package from installation using the comparators shown in the image above. Installing “package_name@<2
” will install the latest version before the release of 2.0.0
. Note the inclusion of quotes surrounding the package name and version.
state install "<package_name[@[<=>]version]>"
For example
state install "requests@<3"
Or using the following format without quotes surrounding the package name and approximate version (“approximate_version
”). This will install the most stable version of the package available in the relative version. Use “x
” to denote the approximate version.
state install <package_name>@<approximate_version>
For example
state install django@4.x
Enter the following format, the package will be uninstalled without the need to specify the version
state uninstall <package_name>
For example
state uninstall requests