Skip to content

Error starting Python extension under code-server #2929

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

Closed
jawnsy opened this issue Mar 18, 2021 · 18 comments
Closed

Error starting Python extension under code-server #2929

jawnsy opened this issue Mar 18, 2021 · 18 comments
Milestone

Comments

@jawnsy
Copy link
Contributor

jawnsy commented Mar 18, 2021

OS/Web Information

  • Web Browser: Version 88.0.4324.182 (Developer Build) built on Debian bullseye/sid, running on Debian bullseye/sid (64-bit)
  • Local OS: Debian testing, using code-server installed as a Progressive Web Application
  • Remote OS: Arch Linux container image, running on Ubuntu host in GKE
  • Remote Architecture: Coder Enterprise
  • code-server --version: 3.9.0-1 06c7e17

Steps to Reproduce

  1. Install the official Python extension
  2. Open the Command Palette (Ctrl+Shift+P) and select "Python: Select Interpreter"

Expected

A list of interpreters should appear

Actual

An error stack is logged to the Log (Remote Extension) log:

[2021-03-18 15:33:45.481] [exthost] [info] ExtensionService#_doActivateExtension ms-toolsai.jupyter {"startup":false,"extensionId":{"value":"ms-python.python","_lower":"ms-python.python"},"activationEvent":"onCommand:python.setInterpreter"}
[2021-03-18 15:33:45.481] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/coder/.local/share/code-server/extensions/ms-toolsai.jupyter-2020.12.1/out/client/extension
[2021-03-18 15:33:45.482] [exthost] [error] Activating extension ms-toolsai.jupyter failed due to an error:
[2021-03-18 15:33:45.488] [exthost] [error] Error: Cannot find module '/home/coder/.local/share/code-server/extensions/ms-toolsai.jupyter-2020.12.1/out/client/extension'
Require stack:
- /opt/coder/code-server/lib/vscode/out/vs/loader.js
- /opt/coder/code-server/lib/vscode/out/bootstrap-amd.js
- /opt/coder/code-server/lib/vscode/out/bootstrap-fork.js
	at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
	at Function.Module._load (internal/modules/cjs/loader.js:841:27)
	at Function.t._load (/opt/coder/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:1093:657)
	at Function.i._load (/opt/coder/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:1062:334)
	at Function.n._load (/opt/coder/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:1058:567)
	at Module.require (internal/modules/cjs/loader.js:1025:19)
	at require (internal/modules/cjs/helpers.js:72:18)
	at Function.r [as __$__nodeRequire] (/opt/coder/code-server/lib/vscode/out/vs/loader.js:20:263)
	at p._loadCommonJSModule (/opt/coder/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:1063:631)
	at p._doActivateExtension (/opt/coder/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:959:742)
	at p._activateExtension (/opt/coder/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:958:822)
	at Object.actualActivateExtension (/opt/coder/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:956:453)
	at h._activateExtension (/opt/coder/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:680:603)
	at /opt/coder/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:680:281
	at Array.map (<anonymous>)
	at h._activateExtensions (/opt/coder/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:680:269)
	at h._activateExtensions (/opt/coder/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:680:338)
	at h.activateByEvent (/opt/coder/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:677:745)
	at p._activateByEvent (/opt/coder/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:957:300)
	at /opt/coder/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:966:111
	at processTicksAndRejections (internal/process/task_queues.js:97:5)

Screenshot

image

Notes

This issue can be reproduced in VS Code: Yes/No

I don't have VSCode installed locally, and would prefer not to install it, sorry

This is possibly related to #2675 or microsoft/vscode-python#14959. It may also be a limitation of Coder's internal extension marketplace

@jsjoeio jsjoeio added the needs-investigation This issue needs to be further investigated label Mar 18, 2021
@code-asher
Copy link
Member

Fingers crossed this might be fixed. 🤞 #2341 (comment)

@oxy
Copy link

oxy commented Mar 20, 2021

I think this might be because the Python extension version we ship right now needs code-server 3.9.1/VSCode 1.53.
Can you try on the latest version?

@jsjoeio jsjoeio added waiting-for-info Waiting for more information from submitter and removed needs-investigation This issue needs to be further investigated labels Mar 22, 2021
@ediphy-dcottrell
Copy link

I think this might be because the Python extension version we ship right now needs code-server 3.9.1/VSCode 1.53.

Can you confirm context of "versoin"? Version of code-server or version of extension?

@jsjoeio
Copy link
Contributor

jsjoeio commented Mar 25, 2021

@ediphy-dcottrell I believe here @oxy is referring to the latest version of code-server: 3.9.1

@qharlie
Copy link

qharlie commented Mar 27, 2021

I was able to get Python working with version (code-server 3.9.2 109d2ce3247869eaeab67aa7e5423503ec9eb859 ) of code-server by doing these in order

  1. Disable extensions.autoUpdate ( label Extensions: Auto update )
  2. Downloading version ms-toolsai.jupyter-2020.11.358541065 of jupyter and installing it ( you can google the whole string )
  3. Downloading version ms-python.python-2020.11.358366026 of python and installing it

This project is so great , it gives me the same excitey feelings as emacs, so great.

@trir262
Copy link

trir262 commented Mar 29, 2021

I am also unable to start python.
local os = Windows 10
remote os = Oracle Linux 7.8
vscode server 1.54.3

installed extensions

  • Python v2021.3.680753044
  • GitLens v11.3.0

Error message:
Cannot activate the 'Python' extension because it depends on the 'Jupyter' extension, which is disabled. Would you like to enable the extension and reload the window?

However Jupyter is not supported on VS Code Server (see my related issue in microsoft/vscode-jupyter#5342 (comment)) and I can not install that extension remotely.

@jsjoeio jsjoeio added needs-investigation This issue needs to be further investigated and removed waiting-for-info Waiting for more information from submitter labels Mar 29, 2021
@jsjoeio jsjoeio added this to the On Deck milestone Mar 29, 2021
@jsjoeio
Copy link
Contributor

jsjoeio commented Mar 29, 2021

@trir262 what version of code-server are you using?

I added this to an upcoming milestone. We'll investigate.

@trir262
Copy link

trir262 commented Mar 29, 2021

I hope I have the right version : 1.54.3
I looked in .vscode-server/bin/2b9aebd5354a3629c3aba0a5f5df49f43d6689f8/package.json

@jsjoeio
Copy link
Contributor

jsjoeio commented Mar 29, 2021

Ah, yes, that's the VS Code version. I meant the code-server version. Here's where you can find it:
2021-03-29 13 51 59

@trir262
Copy link

trir262 commented Mar 29, 2021

Apologies,
Here's my info:
Version: 1.54.3 (system setup)
Commit: 2b9aebd
Date: 2021-03-15T10:55:45.459Z
Electron: 11.3.0
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Windows_NT x64 10.0.19042

@jsjoeio
Copy link
Contributor

jsjoeio commented Mar 29, 2021

No worries at all! Hmm...That looks like VS Code's Help information (not code-server). A few follow-ups:

  • What does your setup look like?
  • How are you using code-server?
  • What version of code-server are you using?

@trir262
Copy link

trir262 commented Mar 29, 2021

Here are the steps I took:

Installed vscode on win10 client
Installed "Remote Development" extension
Connected to SSH Linux endpoint, which installed vscode server
Downloaded vsix for Python, gitlens & jupyter
Installed Python & Gitlens via offline install (linux device has no access to internet)
Unable to install Jupyter (apparently that's not supported, according to my other issue)
Opened a remote path that has a .py file in it
Opened .py file --> Exception appears in bottom screen
I don't run vscode in a web browser but use the client

@jsjoeio
Copy link
Contributor

jsjoeio commented Mar 29, 2021

Ah, that clarifies things a bit. Thanks for the extra notes! We'll investigate this further. Though it sounds like your issue is with the Jupyter extension and not the Python extension? Or rather both I guess.

Do you mind opening a separate issue for the issues with Jupyter and link to that other issue you opened? That way, when we look at separate the two issues.

@trir262
Copy link

trir262 commented Mar 29, 2021

I now went to Extensions and saw the possibility to install the extensions to the remote endpoint. That way I am able to install the extensions and now it does seem to work for me.
I was able to install Jupyter and now python dev works as it should.
There is an inconsistency apparently in installing vsix offline and "Installing extension in remote"

@jsjoeio
Copy link
Contributor

jsjoeio commented Mar 29, 2021

Ah yeah, we could probably do a better job explaining the differences between the two. Well glad you got it working!

@oxy
Copy link

oxy commented Mar 30, 2021

@trir262 hi!

Just noticed this - you appear to be using Microsoft's 'official'/proprietary vscode-server binary, not our open-source code-server tool (which is what this repo is for). We currently do not support connecting to a locally installed VSCode with an extension, and code-server can only be accessed in a web browser.

I've mentioned this on the original issues you've filed upstream too!

@SJang1
Copy link

SJang1 commented Apr 21, 2021

Here went to the same issue, but after updating Python and Jupyter extensions, this error had disappeared.
Error: Cannot find module '/home/username/.local/share/code-server/extensions/ms-toolsai.jupyter-2020.12.1/out/client/extension'

Now Just having this error
[Extension Host] (node:62109) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

and when to try starting thing : Notification comes out : Python extension loading... (Looks like python extension not loading?)

@stale
Copy link

stale bot commented Oct 18, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no activity occurs in the next 5 days.

@stale stale bot added the stale label Oct 18, 2021
@stale stale bot closed this as completed Oct 25, 2021
@code-asher code-asher removed the needs-investigation This issue needs to be further investigated label Jul 11, 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

8 participants