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

Plugin errors when using venv #247

Closed
noot-to-the-noot opened this issue Mar 1, 2023 · 1 comment
Closed

Plugin errors when using venv #247

noot-to-the-noot opened this issue Mar 1, 2023 · 1 comment
Labels
triage-needed Issue is not triaged.

Comments

@noot-to-the-noot
Copy link

noot-to-the-noot commented Mar 1, 2023

After opening a project that uses venv VSCode shows an error message ("Couldn't start client isort") when loading the plugin.

Here is some debug output:

Name: isort
Module: isort
Python extension loading
Waiting for interpreter from python extension.
Python extension loaded
[Error - 14:39:16] Starting client failed
Launching server using command /.venv/bin/python failed.

It seems that somewhere a leading '/' is appended to the path of the Python runtime which causes it to search on root level.
After deleting the venv folder inside my project folder is just seems to run:

Name: isort
Module: isort
Python extension loading
Waiting for interpreter from python extension.
Python extension loaded
CWD Server: /home/dev/source/lambdas/copy_snapshot_tags
sys.path used to run Server:
   /home/dev/.vscode/extensions/ms-python.isort-2023.9.10591013/bundled/libs
   /home/dev/.vscode/extensions/ms-python.isort-2023.9.10591013/bundled/tool
   /usr/lib/python310.zip
   /usr/lib/python3.10
   /usr/lib/python3.10/lib-dynload
   /home/dev/.local/lib/python3.10/site-packages
   /usr/lib/python3.10/site-packages
Settings used to run Server:
[
    {
        "check": false,
        "cwd": "/home/dev/source/lambdas/copy_snapshot_tags",
        "workspace": "file:///home/dev/source/lambdas/copy_snapshot_tags",
        "logLevel": "error",
        "args": [],
        "severity": {
            "W": "Warning",
            "E": "Hint"
        },
        "path": [],
        "interpreter": [
            "/bin/python"
        ],
        "importStrategy": "useBundled",
        "showNotifications": "off"
    }
]

Global settings:
{
    "check": false,
    "cwd": "/home/dev/source/lambdas/copy_snapshot_tags",
    "workspace": "/home/dev/source/lambdas/copy_snapshot_tags",
    "logLevel": "error",
    "args": [],
    "severity": {
        "W": "Warning",
        "E": "Hint"
    },
    "path": [],
    "interpreter": [],
    "importStrategy": "useBundled",
    "showNotifications": "off"
}

/bin/python -m isort --version-number
CWD Linter: /home/dev/source/lambdas/copy_snapshot_tags
Version info for isort running for /home/dev/source/lambdas/copy_snapshot_tags:
5.11.5

SUPPORTED isort>=5.10.1
FOUND isort==5.11.5

Used versions:
Kernel: Linux dev 6.1.12-1-MANJARO #1 SMP PREEMPT_DYNAMIC Tue Feb 14 21:59:10 UTC 2023 x86_64 GNU/Linux
Python (pacman): Python 3.10.9
Python Plugin (VSCode): v2023.2.0
Pylance (VSCode): v2023.2.40
Black Formatter (VSCode): v2023.1.10581010
isort (VSCode): v2023.9.10591013

The same issue exists in Black Formatter, so I'm unsure if the issue originates from any of the plugins or VS Code itself.
Any help is appreciated! If there is anything you need to know just let me know and I'll try my best.

P.S: I've also tried using isort and Black Formatter versions from a couple days ago, but to no avail.

@github-actions github-actions bot added the triage-needed Issue is not triaged. label Mar 1, 2023
@noot-to-the-noot
Copy link
Author

Switching to pre-release of vscode-python as mentioned in microsoft/vscode-python#20660 fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage-needed Issue is not triaged.
Projects
None yet
Development

No branches or pull requests

1 participant