gpt-pilot icon indicating copy to clipboard operation
gpt-pilot copied to clipboard

[Bug]: Does not read .env file to get OpenAI key.

Open ChildOf7Sins opened this issue 11 months ago • 6 comments

Version

VisualStudio Code extension

Operating System

Windows 11

What happened?

When I launch Pythagora in VSCode it says that my free trial has expired, but I already have my OpenAI key in the .env file. The error message also says the wrong key and endpoint. I have revoked this API key already.

image

image

image

ChildOf7Sins avatar Mar 14 '24 20:03 ChildOf7Sins

I was having the same issue. I found that my .env file was not in the correct location. It was located in the /gpt-pilot/ folder. Once I moved it to /gpt-pilot/pilot/ all was well.

80Builder80 avatar Mar 15 '24 06:03 80Builder80

I have the same issue. My .env file is located in the right folder (/gpt-pilot/pilot/). It's still using the wrong key (...b6c2 is not my key), and the wrong endpoint (api.trybricks.ai instead of api.openai.com) error

bfalkenstein avatar Mar 15 '24 17:03 bfalkenstein

I am facing the same problem, the .env file is in the correct location as well. I have my chatgpt API there and it's not being touched I can't get out of that subscription screen

Alexawy82 avatar Mar 16 '24 02:03 Alexawy82

Same here image

rcalastro avatar Mar 16 '24 04:03 rcalastro

Same issue here

actus-1 avatar Mar 17 '24 23:03 actus-1

also same issue here

EDIT: i think i found a solution for my case. i found out i had saved another OpenAI-API-Key in the Environment Variables in Windows 11.

After deleting this Variable and restarting VSCode everything seems working fine.

InterstellarBeing avatar Mar 18 '24 10:03 InterstellarBeing

I have the same issue as above, and removing the environment variable and rebooting the system did not resolve it for me. image I'll try a few other options and poke around a bit.

edit: I couldn't get this working. However, running via the command line (gpt-pilot) appears to work fine with new apps and existing apps. Looks to be a VS code extension issue with Pythagora

nzkritik avatar Mar 20 '24 10:03 nzkritik

also same issue here

EDIT: i think i found a solution for my case. i found out i had saved another OpenAI-API-Key in the Environment Variables in Windows 11.

After deleting this Variable and restarting VSCode everything seems working fine.

This could be it? Where did you look to find it? My Windows system's variables doesn't have any OpenAI API keys, only a Google one.

ChildOf7Sins avatar Mar 20 '24 14:03 ChildOf7Sins

I'm sorry everyone. My issue is fixed though I'm not entirely sure why and I think it's because GPT-Pilot and the VSCode plug in are different. I originally used git to pull down the gpt-pilot repository then pointed the plugin to that directory.

I decided to delete my gpt-pilot folder and start over. This time, I let the plugin handle pulling the repository and setting up it's workspace. Then I found the .env file and added my key to it. Works fine now and I confirmed it's using my OpenAI tokens.

TL:DR Delete your gpt-pilot folder and let the plugin handle everything for you.

ChildOf7Sins avatar Mar 20 '24 16:03 ChildOf7Sins