question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot configure different python paths for the same workspace folder when opened locally and in the container

See original GitHub issue

In my workspace folder, I’d like to be able to have different pythonPath depending on whether it’s open locally or in a container.

In my specific example, for container, it should be /usr/bin/python, and for local env it’s ${workspaceFolder}/.venv/bin/python

I have set "python.pythonPath": "/usr/bin/python" in devcontainer.json, and that works for the container. However, I cannot do the same for local environment - the only option is user-level setting, not repo-level. Once I select python interpreter when opened locally, it overrides .vscode/settings.json, and that changes it for the container.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Feb 10, 2021

Thanks, @luabud ! Works great. I hope this feature gets accepted and implemented 😃

0reactions
karrtikrcommented, Dec 14, 2022

The experiment is now available to all users, closing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Python environments in VS Code
Configuring Python Environments in Visual Studio Code. ... Note: While it's possible to open a virtual environment folder as a workspace, doing so...
Read more >
Importing files from different folder - python - Stack Overflow
When importing a file, Python only searches the directory that the entry-point script is running from and sys.path which includes locations such as...
Read more >
Configure a Python interpreter | PyCharm Documentation
Press Ctrl+Alt+S to open the IDE settings and select Project <project name> | Python Interpreter. · Expand the list of the available interpreters ......
Read more >
Packaging and distributing projects
This section covers some additional details on configuring, packaging and distributing Python projects with setuptools that aren't covered by the ...
Read more >
Understanding the Python Path Environment Variable in Python
Python path is an environment variable used to maintain directories of custom Python libraries. Learn how to set a python path variable on ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found