-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
os.environ['PATH'] will raise KeyError(key) when using Ctrl+F5 or only F5. #436
Comments
Refactor how environment variables are parsed and used in tools, language server and debugger Fixes #316 (PYTHONPATH not used as extra path for auto complete) Fixes #183 (changes to .env file requires restarts of vscode) Fixes #436 (Path variables not inherited when debugging) Fixes #435 (Virtual environment name is same as the default environment file)
@KryptonLee Hi, I met the same issue. How to solve it? |
@KryptonLee this will be fixed in the best release. |
I still see this problem. Why was this closed? |
It has been closed as the issue has been fixed. We haven't released a new version with the fixes though. |
I had the same issue. 2018.1.0-alpha works as expected. |
I still have this problem. I'm on latest vscode version. should I use insiders build to solve this problem? Traceback (most recent call last): this is my project launch.json python debug config: this is my user settings: is there something wrong with my config or what??? please help me. |
@Mahdad-Baghani
Yes please |
I Installed vscode insiders 1.20, still have the same problem. |
@ericsnowcurrently please could you check whether you are able to replicate this using the insiders build? |
Could be due to the different (or incorrect) names of the PATH variables in https://github.com/Microsoft/vscode-python/blob/master/src/client/common/platform/platformService.ts. Could be related to #601 |
@Mahdad-Baghani you need to install the insiders build of the extension, please install it from here (instructions included). https://github.com/Microsoft/vscode-python/blob/master/CONTRIBUTING.md#insiders-build |
I verified that using 0.9.1 running |
I have both insider build 1.20 and insider extension for python, and I also get the same error : import os; print(os.environ['PATH']) Traceback (most recent call last): The one difference that made it work on my side though is if I launch with the option "Python: Terminal (integrated)", it works, but the usual "Python" launch setting doesn't work. |
I faced this issue with some other Python libraries. Till the new version of VSCode is released, I have added a .env file with
That seems to solve the issue for me and I am able to use Python debugger. |
|
@DonJayamanne My os is Ubuntu 17.10. The updated python insiders build extension seems to have worked.
Thanks a lot! |
@DonJayamanne : I am using Mint Linux on Ubuntu 16.04.3 LTS (Xenial Xerus) I removed the .env file and installed the insider build version. I can debug. So that resolves the problem for me. Thanks. |
Hi Team, I am using: Red Hat Enterprise Linux Server release 7.4 (Maipo) I am also getting the same kind of error. I've set environment variables as: MP_IP . I am calling them using: I am getting below error:
I am running it using: Can you please suggest what can be done for it? |
Please create a separate issue. |
Environment data
VS Code version: 1.19.0
Python Extension version: 0.9.0
Python Version: 3.5.2
OS and version: Ubuntu 16.04 64bit
Actual behavior
os.environ['PATH'] will raise KeyError(key) when running a program using Ctrl+F5 or only F5.
But everything is fine when running the program in the console.
Expected behavior
os.environ['PATH'] should get the environment variable PATH.
Steps to reproduce:
The text was updated successfully, but these errors were encountered: