To work with the State Tool you need to create an ActiveState Platform project.
You can create and configure your project in two ways:
To create your account using the State Tool:
Create a new project using the
state init <org>/<project_name> <language>[@version]
state init reference documentation
for usage information.
Follow the instructions on screen.
Once completed switch to the directory where the project was initialized and run
cd ActiveCo/python-web-dev state push
By default only the platform you run the
state init command on is added.
Let’s say you initialize the project on Linux, but you only want macOS and Windows, you can remove Linux and add the latest platforms for macOS and Windows 10:
state platforms remove Linux state platforms add Darwin state platforms add Windows
state platforms reference
documentation for usage information.
Configure packages for your project. You can either add packages individually,
or all at once using a
requirements.txt file (Python)
META.json file (Perl).
To add an individual package:
state install email@example.com
state install reference documentation
To add packages using a requirements.txt file:
state import requirements.txt
state import reference documentation for
TIP: You can search for specific packages on the Platform using
state search subcommand. For example:
state search pandas
lists the versions of pandas that are available.
state search reference documentation for
Activate your project using the activate command:
state activate <owner>/<projectName>
state activate reference documentation
for usage information.
Running the activate command will create a new project folder under the current
working directory containing an
activestate.yaml file with the
essential configuration for your project. The State Tool will “activate” under
this new project directory. This means that you have access to a completely
isolated virtual environment with the language and packages you have
selected in your project.
When you are finished working with your project, you can deactivate the
runtime environment for your project by entering
exit or pressing
to return to your regular shell environment.
When you want to work on your project again you can run the
state activate owner/projectName command from any directory and you’ll be
switched into an activated state under your project directory. Alternatively you
can manually move to the root of your project directory and run
without any other arguments.
Now that you have your project set up and the basics configured check out the following sections to further discover what you can do with the State Tool: