code-server icon indicating copy to clipboard operation
code-server copied to clipboard

Python file is not running - Code-server: 3.10.1

Open rahulml25 opened this issue 5 years ago • 22 comments

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 421237f499079cf88d68c02163b70e2b476bbb0d 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

rahulml25 avatar May 20 '21 04:05 rahulml25

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 https://github.com/cdr/code-server/issues/3364#issuecomment-840513845

code-asher avatar May 20 '21 17:05 code-asher

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.

KingXyr18 avatar May 22 '21 02:05 KingXyr18

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

https://user-images.githubusercontent.com/3806031/119380134-2b627380-bc75-11eb-9a51-8ef96213b92b.mov

jsjoeio avatar May 24 '21 16:05 jsjoeio

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.

ericct avatar May 27 '21 20:05 ericct

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.

Sangwidge avatar May 28 '21 23:05 Sangwidge

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.

marcel-hamer avatar May 29 '21 11:05 marcel-hamer

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

oxy avatar Jun 01 '21 15:06 oxy

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.

ericct avatar Jun 01 '21 17:06 ericct

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 avatar Jun 02 '21 14:06 oxy

@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 avatar Jun 02 '21 14:06 oxy

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.

marcel-hamer avatar Jun 02 '21 17:06 marcel-hamer

@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 avatar Jun 02 '21 18:06 ericct

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

ericct avatar Jun 02 '21 18:06 ericct

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 !

ghost avatar Jun 03 '21 08:06 ghost

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

jsjoeio avatar Jun 03 '21 17:06 jsjoeio

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.

ghost avatar Jun 03 '21 19:06 ghost

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.

jsjoeio avatar Jun 03 '21 19:06 jsjoeio

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 ^^

ghost avatar Jun 03 '21 19:06 ghost

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

jsjoeio avatar Jun 03 '21 19:06 jsjoeio

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!

oxy avatar Jun 03 '21 19:06 oxy