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.

multiroot-workspace-wide "pythonPath" setting is not respected through all folders if it's a relative path

See original GitHub issue

I have one VSC workspace with multiple folders. There is no settings.json or .vscode folder(s), just a single .code-workspace file with all settings, launch and other workspace settings. Here is my folder structure:

  • folder1/:
    • <package 1>/
    • wks/:
      • dev.code-workspace
      • venv/
  • folder2/:
    • <package 2>/
  • folder3/:
    • <package 3>/ …

I want to use venv from folder1 in all folders/packages added to dev.code-workspace, so I set workspace-wide python interpretter setting to python in venv. As it currently works, venv is detected, selected and activated properly for folder1, but not for others. Others report missing python interpretter path setting and therefore also doesn’t work. Am I doing something wrong or is this a bug?

_Originally posted by @schperplata in https://github.com/microsoft/vscode-python/issues/3325#issuecomment-753878681_

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
kimadelinecommented, Mar 10, 2021

Thank you for the clarification! We do have a lot of room for improvement for multiroot workspace support. I marked this issue as preexisting since it’s not anything new that was introduced in a recent release.

0reactions
karrtikrcommented, Jun 7, 2022

Closing in favor of https://github.com/microsoft/vscode-python/issues/18650, relative paths are no longer needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python - Get relative path of all files and subfolders in a directory
Use os.path.relpath() . This is exactly its intended use. import os root_dir = "myfolder" file_set = set() for dir_, _, files in os.walk(root_dir):...
Read more >
Simple trick to work with relative paths in Python | by Mike Huls
The goal of this article is to calculate a path to a file in a folder in your project. The reason we calculate...
Read more >
pathlib — Object-oriented filesystem paths — Python 3.11.1 ...
The target path may be absolute or relative. Relative paths are interpreted relative to the current working directory, not the directory of the...
Read more >
Get parent of current directory using Python - GeeksforGeeks
The relative path for given path will be computed with respect to the directory indicated by start. The default value of this parameter...
Read more >
Working Directories, Absolute and Relative Paths and Other ...
Explain the difference between relative and absolute paths. Check and set your working directory in Python using the os package. What You Need....
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