Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No longer working after addition of THEPIPE_API_KEY #9

Closed
jamespet77 opened this issue Apr 18, 2024 · 5 comments · Fixed by #10
Closed

No longer working after addition of THEPIPE_API_KEY #9

jamespet77 opened this issue Apr 18, 2024 · 5 comments · Fixed by #10

Comments

@jamespet77
Copy link

I have added the env var THEPIPE_API_KEY to my .env, .bashrc and at the commandline. It is not getting accepted.

{response['error']}")
ValueError: Valid environment variable THEPIPE_API_KEY not found. You may need to restart if you have set your API key. Visit https://thepi.pe/docs to learn more.

@emcf
Copy link
Owner

emcf commented Apr 18, 2024

Hi @jamespet77 , did you set THEPIPE_API_KEY to your API key? If so, I'd love to get this fixed for you at our discord https://discord.gg/khsB3667 and push a change to resolve the bug.

@jamespet77
Copy link
Author

Yes.
I did find a workaround.
I added

import dotenv
dotenv.load_dotenv()

to extractor.py

I am not sure why it is not picking up my env vars, but this allowed it to grab my ".env" for the project.

If there is an alternative that is recommended, I am not seeing it in the current documentation.
Screenshot_20240418_112058

@emcf
Copy link
Owner

emcf commented Apr 18, 2024

@jamespet77 Thanks! I think I understand this issue a bit better now -- a system-wide environment variable must be set (the equivalent of export THEPIPE_API_KEY=yourkeyhere in linux), not a .env file environment variable. I will make the readme more clear on this until I can push a change to support this fix. It must also be valid, so if the key is invalid it will return this message.

@jamespet77
Copy link
Author

I tried the system wide in in .bashrc and that did not work either. Maybe it was formatted wrong?? Either way, it would be nice to have it local so that I can use a project specific KEY for it.

@emcf
Copy link
Owner

emcf commented Apr 18, 2024

@jamespet77 I added the dotenv load as you suggested: #3fdda829b2bd82e53926dc0d5bf8fc363e668fa8

Although, if this does not work for you, you can send me your API key at [email protected] and I will investigate this deeper. You can also use it without an API key (see the local installation section).

Thanks for already having spent the time to help with that workaround.

@emcf emcf linked a pull request Apr 19, 2024 that will close this issue
@emcf emcf closed this as completed in #10 Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants