Installing the Gradient Python CLI

Installing the Gradient Python CLI

Learn how to install the Gradient Python CLI.

Learn how to install the Gradient Python CLI and run your first remote workloads from your local computer.

Background info




The Gradient CLI is available on pypi and works on Windows, MacOS, and Linux.

The CLI requires Python 3.4+ (or Python 2.7). Be sure to use a compatible version of pip (or pip3) depending on your Python version.

Pro Tip! We highly recommend installing and using the CLI within a Python virtual environment. This will minimize conflicts with existing libraries on your computer. We recommend virtualenv. See below for more instructions.

Install the CLI

Using pip to install the latest stable release

pip install -U gradient

Connecting your account

You can either stash your API key on your computer or include your API key on each command.

Set your active API key

First, obtain an API Key, and then:


Alternatively, you can include your API key with each command:

gradient experiments run ... --apiKey XXXXXXXXXXXXXXXXXXX

Note: You can reveal your current API key with cat ~/.paperspace/config.json

Obtaining an API key

Sign in to your Paperspace account and create a new API key. You'll use the API keys you generate here to authenticate your requests.

Using a virtual environment

For Python 3.4+

First, install virtualenv:

pip install virtualenv

Create a new virtual environment:

python3 -m virtualenv <virtual_env_dir_path>

Activate the virtual environment:

source <virtual_env_dir_path>/bin/activate

Install the latest prerelease version

pip install -U --pre gradient

  • The gradient-CLI is a public github project you can find at
  • To begin installing, open your terminal application and type pip install -U gradient
  • Note: if you don’t have python already, please visit the docs to learn more.
  • Once the installation has finished, type gradient version to confirm that it is working
  • The gradient CLI requires that you have an API key. Visit the paperspace console and click Create an API key. Give it a name and optional description, and then copy your new key.
  • With your new api key, go back to your terminal and type gradient apiKey and paste your key.
  • If it is successfully added, it will have saved the key to a special folder on your computer so you don’t have to keep typing it in the future.
  • You are now ready to go! The Gradient CLI is a powerful tool that lets you build, train, and deploy machine learning projects.
  • To test it out I will type gradient projects list to view all of my projects.
  • And thats it!
  • You are now ready to start using Gradient.
  • Be sure to checkout the docs and tutorials to learn more!

Key takeaways

  • Learn how to install the Gradient CLI
  • Connect your account by creating an API key
  • Launch your first workload

Similar videos