langflow unable to initialize variables from .env file #2716
Closed
peteBarahon
started this conversation in
General
Replies: 1 comment
-
Hi, @peteBarahon . How are you? The issue has been fixed in PR #2971. Thank you very much for your collaboration! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Langflow is unable to correctly load environment values from a file. The issue resides with the way the run function in main.py attempts to overwrite local variables via the locals()[] structure. This feature seems to not work correctly on Python 3. The offending code was detected in lines 153 to 156.
I corrected the problem by re-evaluating the local variables in question via a separate function.
I also utilized the find_dotenv() as a fallback value for a more reliable env_var variable initialization.
I have attached the file for anyone experiencing the same issue. I am not an active member of this group due to time constraints but I hope this humble contribution helps someone out.
Please download it and use a diff tool to compare it to your own so that you can see the changes made. The file extension was changed to .txt to avoid problems with the attachment not uploading.
main.py.txt
Thank you so much to everyone involved in this project. It's amazing!
Beta Was this translation helpful? Give feedback.
All reactions