Skip to main content

Installation

Install with pip or conda

Install the Stochastic library on your machine in a Python 3 environment using pip or conda.

conda create -n stochastic python=3.8
conda activate stochastic
conda install stochasticx

Check your successful installation:

stochasticx --help
CLI output
Usage: stochasticx [OPTIONS] COMMAND [ARGS]...

Options:
--help Show this message and exit.

Commands:
datasets
deployments
inference
instances
jobs
login
me
models
stable-diffusion

Install from source

Install Stochastic from source with the following command:

pip install git+https://github.com/stochasticai/stochasticx

This command installs the bleeding edge main version rather than the latest stable version. The main version is useful for staying up-to-date with the latest developments. For instance, if a bug has been fixed since the last official release but a new release hasn’t been rolled out yet. However, this means the main version may not always be stable. We strive to keep the main version operational, and most issues are usually resolved within a few hours or a day. If you run into a problem, please open an issue so we can fix it even sooner!

Check your successful installation:

stochasticx --help
CLI output
Usage: stochasticx [OPTIONS] COMMAND [ARGS]...

Options:
--help Show this message and exit.

Commands:
datasets
deployments
inference
instances
jobs
login
me
models
stable-diffusion

Editable install

You will need an editable install if you’d like to:

  • Use the main version of the source code.
  • Contribute to Stochastic library and need to test changes in the code.

Clone the repository and install Stochastic library with the following commands:

git clone https://github.com/stochasticai/stochasticx.git
cd stochasticx
pip install -e .

These commands will link the folder you cloned the repository to and your Python library paths. Python will now look inside the folder you cloned to in addition to the normal library paths. For example, if your Python packages are typically installed in ~/anaconda3/envs/main/lib/python3.7/site-packages/, Python will also search the folder you cloned to: ~/stochasticx/.

Check your successful installation:

stochasticx --help
CLI output
Usage: stochasticx [OPTIONS] COMMAND [ARGS]...

Options:
--help Show this message and exit.

Commands:
datasets
deployments
inference
instances
jobs
login
me
models
stable-diffusion