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

VSCode on remote workstation. Error initializing python #498

Open
Paul-Durrant opened this issue Jun 17, 2024 · 1 comment
Open

VSCode on remote workstation. Error initializing python #498

Paul-Durrant opened this issue Jun 17, 2024 · 1 comment

Comments

@Paul-Durrant
Copy link

I'm trying to use ruff for linting and formatting (replacing pylint and black) when running Python 3.9 in a virtual environment on a remote workstation using VSCode.

The Ruff logging shows:

2024-06-17 08:53:51.099 [info] Name: Ruff
2024-06-17 08:53:51.099 [info] Module: ruff
2024-06-17 08:53:51.099 [info] Python extension loading
2024-06-17 08:53:51.099 [error] Error initializing python:  [TypeError: Cannot read properties of undefined (reading 'onDidChangeActiveEnvironmentPath')
	at t.initializePython (/users/pauld/.vscode-server/extensions/charliermarsh.ruff-2024.26.0-linux-x64/dist/extension.js:1:51861)
	at async Immediate.<anonymous> (/users/pauld/.vscode-server/extensions/charliermarsh.ruff-2024.26.0-linux-x64/dist/extension.js:1:395588)]
2024-06-17 08:53:51.099 [info] Python extension loaded

I have ruff set up as the python formatter, but VSCode reports:
FormattingExtension 'Ruff' is configured as formatter but it cannot format 'Python'-files

Which I suspect is due to the error in the Ruff log.

VSCode version 1.85.2
Python extension version 2022.8.1
Pylance extension version 2022.6.30
Ruff extension version 2024.26.0

VSCode is running on a Mac, Mac OS Sonoma 14.5
The workstation is running Centos 7

relevant settings from VSCode remote settings:

    "[python]": {
        "editor.formatOnSave": true,
        "editor.codeActionsOnSave": {
        "source.fixAll": "explicit",
        "source.organizeImports": "explicit"
        },
        "editor.defaultFormatter": "charliermarsh.ruff"
    },
    "ruff.nativeServer": true,
    "ruff.lint.run": "onSave",
    "ruff.lint.select": [
        "ALL"
    ],
    "ruff.showNotifications": "always",
    "ruff.lint.extendSelect": [
        "ALL"
    ],
    "ruff.lineLength": 88,

@MichaReiser
Copy link
Member

Hmm. I'm not very familiar with remote development. Can you try if #178 helps you fix the issue?

@MichaReiser MichaReiser transferred this issue from astral-sh/ruff Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants