First time caller trying to get this to work, but stuck in the console on what to do

Hi all, I am using the starter plan (it’s a blank slate now) but I have written a python script locally to index certain docs on my hard drive. The script creates a valid output.json file, but the script dies when it tries to upload to Pinecone:

  File "/Users/jigsgaton/Documents/Python_Projects/Working scripts/", line 22, in <module>
    api_key = os.environ["PINECONE_API_KEY"]
  File "<frozen os>", line 679, in __getitem__

Here is the script I am running.

I have keys, that’s all good, and it matches the one in the script, but still no go.