If you have an existing Python project that you want to add to the Platform, you can export a requirements.txt
file to get a list of packages and versions to import into your Platform project, or you can type in the list of packages and versions manually.
To generate a requirements.txt file:
requirements.txt
file using one of the following commands at your command prompt:# python2
python -m pip freeze > requirements.txt
# python3
python3 -m pip freeze > requirements.txt
To create a project from requirements.txt
:
requirements.txt
to use and copy and paste the content, or type in your requirements individually.The Platform parses each entry in your requirements.txt
file and validates the syntax, and identifies any issues. When the file is valid, the platform attempts to match each package requirement with a package and version available on the platform. For supported syntax, see requirements.txt syntax.
requirements.txt
file and the package and versions available on the Platform, you may be able to adjust the package versions individually to create a valid build request.To update an existing project using requirements.txt
:
requirements.txt
to use and copy and paste the content, or type in your requirements individually.pip
requirement specifier syntax:Requirement specifier | Name | Description |
---|---|---|
== | Equal to | An exact match is required. requests==2.18.4 |
> | Greater than | Use any version greater than the specified version. requests>2.18.4 |
>= | Greater than or equal to | Use any version greater than the specified version. requests>=2.18.4 |
< | Less than | Use any version less than the specified version. requests<2.18.4 |
<= | Less than or equal to | Use any version less than or equal to the specified version. requests<=2.18.4 |
~= | Compatible version | Use any version greater than or equal to the specified version, but not greater than the current release series. ~=1.4.2 matches 1.4.2 through 1.4.9) but does not match 1.5.0 |
Requirement specifier syntax that is not applicable to the ActiveState Platform is not supported:
SomeProject ==5.4 ; python_version < '2.7'
) are not supported. Instead, you should specify the appropriate package requirement specifier for your Platform project’s Python version.SomeProject @ file:///somewhere/...
) are not supported because all of the requirements for a Platform project must come from the Platform.