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

Hi Dude! I have the exact same problem! #1

Open
sebascarra opened this issue Mar 18, 2021 · 2 comments
Open

Hi Dude! I have the exact same problem! #1

sebascarra opened this issue Mar 18, 2021 · 2 comments

Comments

@sebascarra
Copy link

Have you been able to solve this issue? It's getting on my nerves. I've been trying to sort this out for hours. Visual Studio Code is NOT detecting my .env file no matter how hard I try. Already put "python.envFile": "${workspaceFolder}/.env" in local and global settings.json, reloaded a bunch of times, but no matter what nothing appears to be taking that setting into account.

Thanks!

@sebascarra
Copy link
Author

So after several hours, from these links I got the big hint:

IN VISUAL STUDIO CODE, UNLIKE PYCHARM (FROM WHERE THIS FUNCTIONALITY WAS RIPPED OFF) THE .env FILE ONLY, ONLY, ONLY IS TAKEN INTO ACCOUNT WHEN RUNNING CODE FROM THE DEBUGGER.

When hitting "play", that's ran from the terminal, so that value is not used.

Microsoft or whoever maintains the Python extension for VS Code has to be more clear about that. Now that I give all these articles a second read, I can tell that people are complaining that this only works from the debugger.

On Pycharm it's just better resolved and there's no ambiguity on how that file is parsed.

microsoft/vscode-python#944
microsoft/vscode-python#9358
microsoft/vscode-python#2206

Thanks for your help anyway. Good luck.

@pjgoodall
Copy link
Owner

I now use pycharm for any serious Python work

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

No branches or pull requests

2 participants