-
Notifications
You must be signed in to change notification settings - Fork 430
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
How to disable python-dotenv #510
Comments
I'm not sure it will solve it, but I thought of a workaround: point to another file via the $ echo "a=1" > .env
$ echo "b=2" > /tmp/dummy.env
$ dotenv list # by default grabs vars from .env
a=1
$ dotenv -f /tmp/dummy.env list # does not grab them when pointing towards other file
b=2 |
The problem is that I don't want dotenv, it is being loaded by a transitive dependency. I don't call the code and there is no way for me to choose the file that it loads. The dotenv cli doesn't help with that as the |
I'm having same problem currently getting warnings since I have set up my .env in another way. |
Adding the following suppressions to my import statements "solved" it. import logging
import warnings
logging.disable(logging.CRITICAL)
with warnings.catch_warnings(action="ignore"):
from litellm import completion |
Quite a lot of packages use this library. I have an .env file which I use for a different purpose and cannot be parsed by python-dotenv. I get a lot of messages like:
Is there an environmental variable that I can set that will disable python-dotenv?
I am not asking about a specific library as I've already encountered this error in flask, pipenv and nltk. Since this library deals with the environment already I think having an environmental variable to disable it is not unreasonable.
The text was updated successfully, but these errors were encountered: