vscode-restructuredtext / vscode-restructuredtext

reStructuredText Language Support in Visual Studio Code
https://marketplace.visualstudio.com/items/lextudio.restructuredtext
Other
344 stars 93 forks source link

[Bug]: Extension does not find python #387

Closed twodrops closed 8 months ago

twodrops commented 2 years ago

Expected behavior

I expected this, if I follow the instructions here, the extension finds the python installation.

Actual behavior

The extension does not seem to find,

The behavior is very random depending on the load order of VsCode extensions. Most of the time, the pop to install ms-python.python is offered, if the python extension is not yet loaded. If the extension is installed via the popup (and not using other means) the extension seems to be always finding the python extension.

Detailed steps

The behavior is present in the attached Vs Code DevContainer project, but very randon. Do "Rebuild Container" to reproduce. sphinx-quickstart.zip

Extension information

187.0.0

Visual Studio Code information

1.65.1

Operating system information

Ubuntu 20.04 (DevContainer)

Python information

3.8.10

Sphinx information

4.5.0

Contents of conf.py

sphinx-quickstart (see attached devcontainer)

Relevant log output

No response

twodrops commented 2 years ago

@danwos @haiyangToAI I know that you both have some experience with this topic. Could you please share your experience?

TomlDev commented 2 years ago

Same problem here, any solution?

twodrops commented 2 years ago

@TomlDev At the moment I reinstall Python VsCode extension after the rST VsCode Extn is installed so that it starts working. Not a real solution, but this is what I do to get it running.

@danwos Any feedback you could give based on the your experience with Python in a similiar VS Code Extension development?

twodrops commented 2 years ago

Is this fix somehow related? https://github.com/vscode-restructuredtext/vscode-restructuredtext/issues/404 (Btw, the link works, it's not a 404 error 😃 )

andersea commented 8 months ago

When I start up vscode I get a popup that says "Python is not installed, or its version is too old. Esbonio language server requires 3.6 and above."

The python extension is installed.

My environment is:

Version: 1.85.2 (user setup) Commit: 8b3775030ed1a69b13e4f4c628c612102e30a681 Date: 2024-01-18T06:40:10.514Z Electron: 25.9.7 ElectronBuildId: 26354273 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Windows_NT x64 10.0.22621

I have python 3.12 installed in "C:\Program Files\Python312"

The system env variables are set like this:

Path=C:\Program Files\Python312\Scripts\;C:\Program Files\Python312\

User env variables are set to:

Path=C:\Users\Anders\AppData\Roaming\Python\Python312\Scripts;C:\Users\Anders\AppData\Roaming\Python\Scripts

PYTHONPATH is not set.

I have VSCode python plugin v2023.22.1 and pylance v2023.12.1.

I can start python from the command line. I have poetry installed and it finds python ok. Poetry venv works and vscode can find them and use them for testing.

I can preview files with reStructuredtext but autodoc extension doesn't work and it doesn't seem to format or style the documentation.

lextm commented 8 months ago

@andersea your setup hit multiple known issues. You might upgrade to latest prerelease.

andersea commented 8 months ago

That removes the error, but I can't get previews to work. The extension logs gives me this:

2024-01-21 19:47:44.907 [error] Canceled: Canceled
    at LanguageClient2.handleFailedRequest (c:\Users\Anders\.vscode\extensions\swyddfa.esbonio-0.92.1\dist\node\extension.js:16203:23)
    at c:\Users\Anders\.vscode\extensions\swyddfa.esbonio-0.92.1\dist\node\extension.js:13279:27
    at async d.h (c:\Users\Anders\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:141:140086)
    at async PreviewManager.previewEditor (c:\Users\Anders\.vscode\extensions\swyddfa.esbonio-0.92.1\dist\node\extension.js:18839:18)
    at async PreviewManager.openPreview (c:\Users\Anders\.vscode\extensions\swyddfa.esbonio-0.92.1\dist\node\extension.js:18797:12) esbonio.server.previewFile {"value":"swyddfa.esbonio","_lower":"swyddfa.esbonio"}

Edit: I uninstalled this plugin and installed esbonio standalone v0.11.0. Now I can get previews with ctrl+shift+v combination.

lextm commented 8 months ago

Close this issue now as the relevant code has been removed in latest prerelease.