4

Here's the tutorial: https://www.planet.com/docs/api-quickstart-examples/cli/

Install the Planet CLI with:

pip install planet

If you have not already, get your API key at planet.com/account, and add it to your environment:

export PL_API_KEY=a3a64774d30c4749826b6be445489d3b # (not a real key)

This 'export' does not work (is not showing to be a variable). I manually entered my PlanetLabs API Key in my os environment (https://planetlabs.github.io/planet-client-python/api/examples.html#importing-the-api), but no happy end.

1
  • To confirm, after you use export, if you type printenv in the same window this PL_API_KEY variable does not appear in the list of environment variables? Also a reminder if you want to make it permanent you'll need to add to bash profile.
    – SMiller
    Commented May 3, 2018 at 16:52

2 Answers 2

3

From the Python 3 environment, you can do this:

os.environ['PL_API_KEY']='YOUR_API_KEY_HERE'
1

How you set an environment variable is dependent on what shell you are using. The instructions in the documentation may not be valid for you, since they assume you are using bash.

As an alternative, you can run planet init to store your credentials in a configuration file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.