Hi everyone, hope you all are staying safe
I’ve been searching the internet for the solution but I can’t seem to find what is the issue with my code. (update: I’m coding a simple web scrapper)
While using the python-dotenv 0.15.0 python package, I can’t get the email address from the .env file
python file (I used this file to test how to use a value from the .env file)
from dotenv import load_dotenv
The output will show User instead of the email address.
Thanks for reading the question, any tips for the reason why is this happening will be much appreciated. Also, keep staying safe.
There is not a lot to look at in these 2 code blocks you have given us. Right now, I don’t know if you have imported the
os modules or not. I don’t know if there is other variable values inside the
.env files. I don’t know what package you are using exactly, there is a couple of dotenv packages for python out there. I don’t know if there is other part of the code that could cause this to happen.
Unless the whole python and
.env files contains only what you’ve given us inside the 2 code blocks, Please give us more specifics.
Here’s an example of a repl I tried and it worked perfectly fine:
Thank you and Happy Coding.
Good day @Catalactics, sorry for not specifying the package that I used and I seem to forget to paste one line from my code. I’ve updated the post and it seems that your example code and compared to mine, they’re the same. Another thing is that is it possible that the package took the value from my window’s environment? Because I named my computer’s username as User… Thank you.
Well, I solved the problem, the package indeed took the value from my window environment. So I changed the variable name to ACC_USERNAME instead of USERNAME. Anyway thanks @Catalactics