1

i´m trying to use Replicate to run some neural networks in the cloud but it yields this error message:

ReplicateError: No API token provided. You need to set the REPLICATE_API_TOKEN environment variable or create a client with `replicate.Client(api_token=...)`.

You can find your API key on https://replicate.com

and python also can´t find it with the command

print(os.environ.get("REPLICATE_API_TOKEN"))

i already tried passing it using sysdm.cpl and it still doesnt work. How do I set it as an environmental variable?

1 Answers1

6

you can set the api key within the python

import os
import replicate

#Set the REPLICATE_API_TOKEN environment variable
os.environ["REPLICATE_API_TOKEN"] = "your_api_token_here"
mozway
  • 194,879
  • 13
  • 39
  • 75
Wasteland Lab
  • 61
  • 1
  • 3