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

Python file is not running - Code-server: 3.10.1 #3425

Closed
rahulml25 opened this issue May 20, 2021 · 22 comments
Closed

Python file is not running - Code-server: 3.10.1 #3425

rahulml25 opened this issue May 20, 2021 · 22 comments
Assignees
Labels
bug Something isn't working extension The issue needs to be fixed in the extension high-priority This issue needs to be resolved ASAP waiting-for-info Waiting for more information from submitter
Milestone

Comments

@rahulml25
Copy link

rahulml25 commented May 20, 2021

OS/Web Information

  • Web Browser: Edge
  • Local OS: Linux - Ubuntu 20.04 LTS
  • Remote OS: Ubuntu 20.04 LTS
  • Remote Architecture: VM
  • code-server --version: 3.10.1 421237f Latest

Steps to Reproduce

  1. Run a python file in terminal

Expected

It should run my python file.

Actual

  • The terminal is not opening!
  • Throwing two errors:
    • command : 'python.execlnTerminal' not found
    • command : 'python.execlnTerminal-icon' not found

Logs

backend.log

Screenshot

Screenshot_2021-05-20-09-55-38-390_com microsoft emmx

Notes

This issue can be reproduced in VS Code: Yes

@code-asher
Copy link
Member

code-asher commented May 20, 2021

It's possible this is because our Python extension is broken. Uninstalling Python and Jupyter and installing Python from Open VSX instead might work around the issue for now (the Python extension on Open VSX is bundled with Jupyter).

See #3364 (comment)

@KingXyr18
Copy link

I have exactly the same issue as you. But I figured it out that it was simply a bug of ms-python extension. Just choose an old version and hopefully the problem will be solved.

@jsjoeio
Copy link
Contributor

jsjoeio commented May 24, 2021

Interesting...I could not reproduce this issue locally. I'm using the Python extension v2021.5.842923320 with code-server 3.10.1 on macOS + Chrome.

Screenshot

Screen.Recording.2021-05-24.at.9.47.10.AM.mov

@ericct
Copy link

ericct commented May 27, 2021

I have exactly the same issue, with 3.10.1 and 3.10.2. It's not just for Python execution, but also when I try to select the interpreter, I have this error:

Command 'Python: Select Interpreter' resulted in an error (command 'python.setInterpreter' not found)

Also, I've manually installed the latest version of Python extension (that works on 3.10.0 and downwards), with the same result.

@Sangwidge
Copy link

Interesting...I could not reproduce this issue locally. I'm using the Python extension v2021.5.842923320 with code-server 3.10.1 on macOS + Chrome.

Screenshot

Screen.Recording.2021-05-24.at.9.47.10.AM.mov

I have this same issue, appears to only be an issue when clicking the play button in the top right, if I type out my command as you did then it runs as expected.

I am a total novice so cannot speculate as to why this issue is arising, I am only using the platform currently as a learning tool.

@marcel-hamer
Copy link

marcel-hamer commented May 29, 2021

I had the same issue after upgrading to 3.10.2. For me it turned out to be the version of Jupyter v2021.5.0 not working correctly.

After reverting to v2021.3.0 everything started working fine again. Maybe it is worth a try.

@oxy
Copy link

oxy commented Jun 1, 2021

Heads up - I'm looking at Jupyter again and will try to land a fix soon, depending on how complex the bug is.

@oxy oxy self-assigned this Jun 1, 2021
@oxy oxy added bug Something isn't working extension The issue needs to be fixed in the extension high-priority This issue needs to be resolved ASAP labels Jun 1, 2021
@oxy oxy added this to the 3.11.0 milestone Jun 1, 2021
@ericct
Copy link

ericct commented Jun 1, 2021

Workaround reported by @marcel-hamer does not work for me (but using 3.10.0, see below):

  • with versions 3.10.1 and 3.10.2 I can no longer select the Python interpreter;
  • then, with version 3.10.0, reverting to Jupyter v2021.3.0 has no impact

Actually, the problem is hard to bisect (for me). I've came across a working solution with 3.10.2, but after an un-recorded upgrade path... When trying to remove everything, including user .local settings and install from scratch, I cannot get any combination of code-server and Python/Jupyter extensions that works.

@oxy
Copy link

oxy commented Jun 2, 2021

Hey there, I've pushed new versions of the extensions, can you please install ms-python.python 2021.5.842923320 and ms-toolsai.jupyter 2021.6.832593372 and report back?

PS: there appears to be an upstream bug that causes autocomplete to break (without Pylance, which we are not allowed to ship) with the LSP set to Default, so please change the language server to Jedi in the Python extension settings.

@oxy
Copy link

oxy commented Jun 2, 2021

@ericct it's possible you were running into a similar bug to the one I ran into while diagnosing this - with the language server set to default, closing and reopening made autocomplete no longer work correctly.

Can you update both extensions, set the LSP to Jedi, and try again?

@oxy oxy added the waiting-for-info Waiting for more information from submitter label Jun 2, 2021
@marcel-hamer
Copy link

Hey there, I've pushed new versions of the extensions, can you please install ms-python.python 2021.5.842923320 and ms-toolsai.jupyter 2021.6.832593372 and report back?

For me this fixed the issue.

@ericct
Copy link

ericct commented Jun 2, 2021

@ericct it's possible you were running into a similar bug to the one I ran into while diagnosing this - with the language server set to default, closing and reopening made autocomplete no longer work correctly.

Can you update both extensions, set the LSP to Jedi, and try again?

I've just updated the extensions with the versions mentioned and set LSP to Jedi: With interactive code or notebook, the Python environment starts correctly and I can run "Python: Select interpreter".

But then with interactive code and notebook, any cell with output will fail (Chunk load error / timeout behavior)

@ericct
Copy link

ericct commented Jun 2, 2021

But everything seems to be OK so far with v3.10.2 👍

@ghost
Copy link

ghost commented Jun 3, 2021

Hi !

Is it possible to download ms-python.python 2021.5.842923320 and ms-toolsai.jupyter 2021.6.832593372 offline ?
I've triied to download these extensions but I get an error : cannot access extensions.coder.com because I'm in offline env.

Is where I've downloaded : https://sotnikov-link.github.io/get-vscode-extension-for-offline-install/

Is exists a simple way to download last working extensions for last code-server ?

Thanks !

@jsjoeio
Copy link
Contributor

jsjoeio commented Jun 3, 2021

We have some docs about installing extensions manually here but you do need to be online to download them. Once they're downloaded though, you should be fine.

Is exists a simple way to download last working extensions for last code-server

The latest version of code-server should work with the Python extension (just downloaded now). But the marketplace and code-server are decoupled meaning you can downgrade code-server but the marketplace will download the latest version of the extension. There is an option to download older versions of the extension but if you downgrade code-server, you'll have to test previous versions to see what works.

image

@ghost
Copy link

ghost commented Jun 3, 2021

Thanks for your reply !
How can I export the .vsix file ?
I need this to transfert the file to my offline env.

EDIT : I have always : cannot access extensions.coder.com when I use my .vsix file to my offline install.

@jsjoeio
Copy link
Contributor

jsjoeio commented Jun 3, 2021

Hmm...I think when extensions are installed, the .vsix files are unpacked 🤔 So you'd have to download outside of code-server.

You could talk directly to the open-vsx API. Example:

curl 'https://open-vsx.org/api/foam/foam-vscode' | jq '.files.download' | xargs curl --compressed -L -o foam.vsix

And then you'd have the .vsix file and you could put it on a USB drive or something to transfer to your offline env.

@ghost
Copy link

ghost commented Jun 3, 2021

Thanks!
In openvsx server, the python's version is 2020, is it possible to get the latest ?
(https://open-vsx.org/extension/ms-python/python)
Or maybe is not possible or 2020 is enough ?

It's difficult to manage an offline env ^^

@jsjoeio
Copy link
Contributor

jsjoeio commented Jun 3, 2021

Ah shoot...that's right. Hmm.. I am not sure how to get the latest 😅 cc @oxy or @code-asher - maybe they can help.

It's difficult to manage an offline env ^^

I can imagine! Props to you lol

@oxy
Copy link

oxy commented Jun 3, 2021

Ah, right -

You first need to install ms-toolsai.jupyter before you install ms-python.python when you're installing offline.

What happens is that when you install Python, Jupyter is listed as a mandatory dependency, and by default VSCode will try and resolve that against the default gallery. But since the dependency isn't the other way around, installing Jupyter first and Python second should work!

@ghost
Copy link

ghost commented Jun 3, 2021

Okay all rigthts !

I've triied this :
Downloaded here : https://sotnikov-link.github.io/get-vscode-extension-for-offline-install/

# code-server --install-extension Téléchargements/jupyter.VSIXPackage
Installing extensions...
[2021-06-03T19:50:50.534Z] error vscode getaddrinfo EAI_AGAIN extensions.coder.com
[2021-06-03T19:50:50.534Z] error vscode Error: getaddrinfo EAI_AGAIN extensions.coder.com
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26)

Why code-server hits coder.com ?

When online :

Installing extensions...
[2021-06-03T19:54:46.793Z] error vscode Unexpected end of JSON input:

[2021-06-03T19:54:46.796Z] error vscode SyntaxError: Unexpected end of JSON input:

    at JSON.parse (<anonymous>)
    at D (/usr/lib/code-server/lib/vscode/out/vs/server/entry.js:24:74905)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async x.queryGallery (/usr/lib/code-server/lib/vscode/out/vs/server/entry.js:27:10711)
    at async x.query (/usr/lib/code-server/lib/vscode/out/vs/server/entry.js:27:9654)
    at async x.getExtensions (/usr/lib/code-server/lib/vscode/out/vs/server/entry.js:27:7344)
    at async /usr/lib/code-server/lib/vscode/out/vs/server/entry.js:19:670
    at async Promise.all (index 0)
    at async O.getGalleryExtensions (/usr/lib/code-server/lib/vscode/out/vs/server/entry.js:19:639)
    at async O.installExtensions (/usr/lib/code-server/lib/vscode/out/vs/server/entry.js:18:26265)
    at async /usr/lib/code-server/lib/vscode/out/vs/server/entry.js:36:90861
    at async M (/usr/lib/code-server/lib/vscode/out/vs/server/entry.js:36:94206)
    at async process.<anonymous> (/usr/lib/code-server/lib/vscode/out/vs/server/entry.js:36:103823)

Maybe, an error while downloading ?

Thanks for your help, really !

@oxy
Copy link

oxy commented Jun 7, 2021

@Rwanito Could you create another issue for this actually? The current issue (the Python extension not working) was fixed, but installing extensions offline is a separate issue that we'd have to address.

@oxy oxy closed this as completed Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working extension The issue needs to be fixed in the extension high-priority This issue needs to be resolved ASAP waiting-for-info Waiting for more information from submitter
Projects
None yet
Development

No branches or pull requests

8 participants