-
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
Interpreter not Picked up From settings.json
, and Multiple Paths not Working
#14798
Comments
Same problem here. I also tried to create a new project, initialize venv inside cwd and reopen folder and now I get the message: I installed Code and Python extension inside VM to eliminate problem with my configuration and I get the same type of error. Although when I hit run it finds somehow path to python. Environment data:Version: 1.51.1 |
Also same here! OS: Linux x64 5.9.8-arch1-1 |
ah also, looking at other issues & releases, according to a recent release, and issue #12462, this has been changed. I'm not quite sure about how this affects things, but it is a possibility. |
Hello @RishabhMalviya and @ShadiestGoat, thank you for reaching out. The If you want to specify extra paths like your workspace root, you should use the |
@kimadeline Thanks for the helpful reply. As explained in the links you sent, I added the following to my
(I'm working inside a Docker container, and the absolute path And following the steps taken by the OP in #12085, I added the
Auto-complete and debugging are working as expected now! Is linting not part of the core VSCode Python extension? |
Hi @RishabhMalviya, Linting is supported by the extension, although you'll have to install your own linter. Please open a separate issue since it is unrelated to what was initially reported, and specify there which linter you use as well. Thanks! |
Environment data
python.languageServer
setting: JediExpected behaviour
The Python Interpreter should be picked up from the
"python.pythonPath"
key insettings.json
.Also, one should be able to specify multiple paths in the
"python.pythonPath"
insettings.json
. In particular, I would like to point to:This is to ensure linting and auto-complete to work properly:
(In the case of multiple paths, the Python interpreter should be picked up from the first path.)
Actual behaviour
Every time I open VSCode or I try to run/debug my Python files, I am shown the following prompt: "You need to select a Python interpreter before you start debugging."
When I do so (selecting
/usr/local/bin/python
from the drop-down), it overwrites thesettings.json
file and removes the${workspaceFolder}
:This causes red linting to begin showing up in my code, because I am performing certain imports from the root of my working directory (and it has been removed from the
settings.json
).Steps to reproduce:
API_TOKEN
in line 13 on the.env
file:docker-compose up -d model-dev
. Wait for the container to come up."Remote-Containers: Attach to Running Container"
, and attach to themodel-dev
container you brought up in the previous step./app
in the VSCode instance.ms-python.python
) Extension is installed. If not, install it. You may also get a prompt to"install Linter pylint"
. Install it as well.app.py
and try to run it.Select Python Interpreter
, and choose the interpreterPython 3.9.0 64-bit /usr/local/bin/python
.app.py
, and there should be corresponding entries in theProblems
panel on the bottom.settings.json
back to the original:app.py
again. You'll be forced to select a Python interpreter again.Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)The text was updated successfully, but these errors were encountered: