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

command 'python.setInterpreter' not found when using code-server > 3.4.1 #12465

Closed
yijingru opened this issue Jun 19, 2020 · 28 comments
Closed
Assignees
Labels
area-editor-* User-facing catch-all bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster investigating We are looking into the cause of the issue regression Bug didn't exist in a previous release verified Verification succeeded
Milestone

Comments

@yijingru
Copy link

yijingru commented Jun 19, 2020

Hi,

I think my code-server updates the python version (2020.6.88468) automatically, and yesterday I cannot add the python interpreter, the command windows outputs:

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

I rolled back the python version, but it does not help. For example, python2020.5.80290 can add the interpreter, but it raises another problem of the debugger

Error: The number of constructor arguments in the derived class s must be >= than the number of constructor arguments of its base class.
    at /root/.local/share/code-server/extensions/ms-python.python-2020.5.80290/out/client/debugger/debugAdapter/main.js:16:49625

The following information is the coder-server version and vs code version:

code-server: v3.4.1
VS Code: v1.45.1
@yijingru yijingru added data science bug Issue identified by VS Code Team member as probable bug labels Jun 19, 2020
@frozen-icecube
Copy link

frozen-icecube commented Jun 20, 2020

The title of the jira should be constructor args mismatch causing debug adapter to fail and not being able to load debugger for python.

I have now tried code-server version 3.2.0, 3.3.1 and 3.4.1 with various combinations of ms-python versions.

ms-python 2020.6.88468 does not even load. So i tried with all the way back down to 2020.3.69010. The older versions load but they are getting the mismatched constructor args issue.

Does anyone know what changed in ms-python / language server as code-server 3.3.1 was working fine along with older 2020.5.x version of ms-python?

Is this potentially due to debugpy related switch or an inversifyjs issue ?

I even tried with using the latest node-v14.4.0 but that also does not help...

Actual error :

Error: The number of constructor arguments in the derived class s must be >= than the number of constructor arguments of its base class.

Error Log File : debugger.vscode_8d2dc057-6410-479a-8896-afb0ba5c2d69.log

Thanks for any suggestions...

Also raised a jira on code-server side : coder/code-server#1821

@karrtikr
Copy link

The rollback issue was because of a bug which opted users out of experiments. It should be fixed now with da85a76
Reload to activate the extension again, which will download the fresh experiments. Then reload again and the extension will be activated using the new experiments.

@yijingru
Copy link
Author

Thank you @karrtikr, the python extension 5.86806 now is good. But the newest version 6.89148 still has the problem of Error: The number of constructor arguments in the derived class s must be >= than the number of constructor arguments of its base class, and the previous version 6.89468 cannot load the python interpreter. But anyway, I can use 5.86806 instead. Thanks a lot!!

@frozen-icecube
Copy link

frozen-icecube commented Jun 22, 2020

I found a solution. You have to move to code-server 3.4.1 and then downgrade ms-python to 2020.5.x and all will be good.

@yijingru
Copy link
Author

@gauravk88 thanks.

@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Jun 22, 2020
@karrtikr karrtikr reopened this Jun 22, 2020
@ghost ghost added the triage-needed Needs assignment to the proper sub-team label Jun 22, 2020
@karrtikr
Copy link

Reopened because we would like to get to the bottom of the issue

@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Jun 22, 2020
@kimadeline
Copy link

kimadeline commented Jun 22, 2020

Hi @yijingru and @gauravk88,

Can you copy the output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python) when you're on the latest version of the Python extension (2020.6.89148)?

Can you also check if you have multiple versions of the Python extension installed and delete the old ones (in /root/.local/share/code-server/extensions/)?

Thanks!

@kimadeline kimadeline added the info-needed Issue requires more information from poster label Jun 22, 2020
@yijingru
Copy link
Author

yijingru commented Jun 22, 2020

Hi @kimadeline, the python extension 2020.6.89148 raises error Command 'Python: Select Interpreter' resulted in an error (command 'python.setInterpreter' not found) so I don't have the Python in the Output panel for this version. This issue is different from the debugger problem this morning. The same problem for 2020.6.88468, 2020.5.2.

@frozen-icecube
Copy link

frozen-icecube commented Jun 22, 2020

Hi @yijingru and @gauravk88,

Can you copy the output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python) when you're on the latest version of the Python extension (2020.6.89148)?

Can you also check if you have multiple versions of the Python extension installed and delete the old ones (in /root/.local/share/code-server/extensions/)?

Thanks!

@kimadeline So to recreate the issue simply take code-server version 3.3.1 and install the latest version of ms-python extension available in marketplace in code-server : 2020.6.89148.

I have no other extension installed and when i reload the screen to activate ms-python extension i get an error when i try to discover tests

The error is : Command 'Python: Discover Tests' resulted in an error (command 'python.discoverTests' not found)

The python log is as given below :

User belongs to experiment group 'AlwaysDisplayTestExplorer - experiment'
User belongs to experiment group 'ShowPlayIcon - start'
User belongs to experiment group 'ShowExtensionSurveyPrompt - enabled'
User belongs to experiment group 'DebugAdapterFactory - experiment'
User belongs to experiment group 'PtvsdWheels37 - experiment'
User belongs to experiment group 'UseTerminalToGetActivatedEnvVars - control'
User belongs to experiment group 'AA_testing - experiment'
User belongs to experiment group 'LocalZMQKernel - control'
User belongs to experiment group 'CollectLSRequestTiming - control'
User belongs to experiment group 'CollectNodeLSRequestTiming - experiment'
User belongs to experiment group 'EnableIPyWidgets - experiment'
User belongs to experiment group 'RunByLine - control'
User belongs to experiment group 'CustomEditorSupport - control'
> python3.7 ~/.local/share/code-server/extensions/ms-python.python-2020.6.89148/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3.6 ~/.local/share/code-server/extensions/ms-python.python-2020.6.89148/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3 ~/.local/share/code-server/extensions/ms-python.python-2020.6.89148/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python2 ~/.local/share/code-server/extensions/ms-python.python-2020.6.89148/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python ~/.local/share/code-server/extensions/ms-python.python-2020.6.89148/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python ~/.local/share/code-server/extensions/ms-python.python-2020.6.89148/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> conda --version
> pyenv root
> conda info --json
Python interpreter path: /usr/bin/python

Please let me know, if you want me to debug this through further..

Also, the arguments mismatch error is different and happening on all code-server versions except the latest version 3.4.1 : https://github.com/cdr/code-server/releases/download/v3.4.1/code-server-3.4.1-linux-amd64.tar.gz even with ms-python 2020.5.86806

If you upgrade code-server to 3.4.1 and downgrade ms-python to 2020.5.86806 then everything is fine.

Thanks,
Gaurav

@kimadeline
Copy link

Thank you both for your replies! I'll mark the issue as a regression, and in the meantime feel free to upvote the original comment to help us prioritize this fix.

I can confirm it's still an issue with version 2020.6.90262 of the Python extension, and the latest version of code-server (3.4.1).

Repro steps:

  • Install code-server (instructions here), I did it in a Docker instance:
    • Open an existing Python workspace in a Docker container
    • Call the code-server install script from the terminal there
  • Launch code-server (just type code-server in the terminal), access the instance in the browser and open a Python file to try and activate the extension
  • Open the browser developer tools, this error appears (happens during activation):
Failure during activation. [Error: The number of constructor arguments in the derived class o must be >= than the number of constructor arguments of its base class.
	at /root/.local/share/code-server/extensions/ms-python.python-2020.6.89148/out/client/extension.js:39:261081
	at Array.forEach (<anonymous>)
	at e (/root/.local/share/code-server/extensions/ms-python.python-2020.6.89148/out/client/extension.js:39:260644)
	at /root/.local/share/code-server/extensions/ms-python.python-2020.6.89148/out/client/extension.js:39:261118
	at Array.forEach (<anonymous>)
	at /root/.local/share/code-server/extensions/ms-python.python-2020.6.89148/out/client/extension.js:39:261097
	at Array.forEach (<anonymous>)
	at e (/root/.local/share/code-server/extensions/ms-python.python-2020.6.89148/out/client/extension.js:39:260644)
	at /root/.local/share/code-server/extensions/ms-python.python-2020.6.89148/out/client/extension.js:39:261118
	at Array.forEach (<anonymous>)
	at /root/.local/share/code-server/extensions/ms-python.python-2020.6.89148/out/client/extension.js:39:261097
	at Array.forEach (<anonymous>)
	at e (/root/.local/share/code-server/extensions/ms-python.python-2020.6.89148/out/client/extension.js:39:260644)
	at /root/.local/share/code-server/extensions/ms-python.python-2020.6.89148/out/client/extension.js:39:261118
	at Array.forEach (<anonymous>)
	at /root/.local/share/code-server/extensions/ms-python.python-2020.6.89148/out/client/extension.js:39:261097
	at Array.forEach (<anonymous>)
	at e (/root/.local/share/code-server/extensions/ms-python.python-2020.6.89148/out/client/extension.js:39:260644)
	at /root/.local/share/code-server/extensions/ms-python.python-2020.6.89148/out/client/extension.js:39:261118
	at Array.forEach (<anonymous>)
	at /root/.local/share/code-server/extensions/ms-python.python-2020.6.89148/out/client/extension.js:39:261097
	at Array.forEach (<anonymous>)
	at e (/root/.local/share/code-server/extensions/ms-python.python-2020.6.89148/out/client/extension.js:39:260644)
	at Object.t.plan (/root/.local/share/code-server/extensions/ms-python.python-2020.6.89148/out/client/extension.js:39:261159)
	at /root/.local/share/code-server/extensions/ms-python.python-2020.6.89148/out/client/extension.js:39:257812
	at e._get (/root/.local/share/code-server/extensions/ms-python.python-2020.6.89148/out/client/extension.js:39:257721)
	at e.get (/root/.local/share/code-server/extensions/ms-python.python-2020.6.89148/out/client/extension.js:39:256432)
	at a.get (/root/.local/share/code-server/extensions/ms-python.python-2020.6.89148/out/client/extension.js:48:999781)
	at /root/.local/share/code-server/extensions/ms-python.python-2020.6.89148/out/client/extension.js:39:280985
	at processTicksAndRejections (internal/process/task_queues.js:97:5)]

Running any command associated to the Python extension afterwards will fail with a Command not found because the extension didn't activate properly.

Notes:

@kimadeline kimadeline added area-editor-* User-facing catch-all needs spike Label for issues that need investigation before they can be worked on. regression Bug didn't exist in a previous release and removed info-needed Issue requires more information from poster triage labels Jun 26, 2020
@ZandercraftGames
Copy link

@ZandercraftGames do you have the 'ms-toolsai.jupyter extension installed?

It is in the error message:

Cannot activate extension 'Python' because it depends on extension 'ms-toolsai.jupyter'

Yes, I do have it installed. When installing the Python extension, it automatically installs Jupyter and wont let you uninstall it as it is a dependancy of Python. I also tried uninstalling the Python and Jupyter extensions, then installing Jupyter on it's own and then the Python extension after to no avail.

@kimadeline
Copy link

Thank you for the clarification 🙂 Could you open a separate issue for your problem? If it turns out it has the same root as this one we'll fold them back together.

Thanks!

@ITmind
Copy link

ITmind commented Jan 23, 2021

installing version 2020.10.332292344 solves the problem

@meilier
Copy link

meilier commented Jan 29, 2021

code-server 3.4.1 and then downgrade ms-python to 2020.5.x works, any information about the new version?

@LVerneyPEReN
Copy link

In case this can be useful (I did not see mentions of code-server >= 3.5), I can reproduce the issue in code-server v3.7.4 (vscode v1.51.1) / ms-python v2021.1.502429796.

@Whitie
Copy link

Whitie commented Jan 29, 2021

I can reproduce the issue also with code-server 3.8.0 (vscode 1.51.1 / ms-python v2021.1.502429796). It's on Arch Linux if this matters.

@ghost
Copy link

ghost commented Jan 31, 2021

I installed code-server manually (so not with docker basically) and i'm using python3 in the console to call python and run my apps
For example : python3 ./something.py

@conan-ed
Copy link

conan-ed commented Mar 9, 2021

Same problem with code-server in docker version with newest python extension 2021.2.633441544:
code-server: v3.9.1
VS Code: v1.53.2
I suspect the problem come from extension Jupyter which is required by newest python ext.
Uninstall python ext then install older version v2020.10.332292344 using vsix fix this problem (disable ext auto update first).

@frozen-icecube
Copy link

Same problem with code-server in docker version with newest python extension 2021.2.633441544:
code-server: v3.9.1
VS Code: v1.53.2
I suspect the problem come from extension Jupyter which is required by newest python ext.
Uninstall python ext then install older version v2020.10.332292344 using vsix fix this problem (disable ext auto update first).

Yes the problem is not solved. The only solution is to use ms-python 2020.10.332292344 version...

@karrtikr
Copy link

The following comment dated Jun 18, 2021 coder/code-server#1837 (comment) states this is no longer an issue with latest versions of Jupyter and Python extension, the latest comment on this issue was on Mar 9, 2021. Can anyone confirm if this is still an issue?

@karrtikr karrtikr added the info-needed Issue requires more information from poster label Mar 18, 2022
@brettcannon brettcannon modified the milestones: March 2022, April 2022 Mar 21, 2022
@japita-se
Copy link

Same problem with code-server in docker version with newest python extension 2021.2.633441544:
code-server: v3.9.1
VS Code: v1.53.2
I suspect the problem come from extension Jupyter which is required by newest python ext.
Uninstall python ext then install older version v2020.10.332292344 using vsix fix this problem (disable ext auto update first).

Yes the problem is not solved. The only solution is to use ms-python 2020.10.332292344 version...

I confirm. This is the only solution. 2022 version does not work.

@karrtikr karrtikr removed the info-needed Issue requires more information from poster label Mar 27, 2022
@karrtikr
Copy link

karrtikr commented Apr 11, 2022

Unfortunately I'm unable to reproduce the issue using the instructions in Docker here: https://coder.com/docs/code-server/latest/install#docker.

@japita-se Can you describe how you installed & launched the code-server? Please also paste the logs and errors you see. Make sure you're using the latest version of VSCode and code-server. (Run code-server --version to find out the version)

@karrtikr karrtikr added info-needed Issue requires more information from poster investigating We are looking into the cause of the issue and removed needs spike Label for issues that need investigation before they can be worked on. labels Apr 11, 2022
@karrtikr
Copy link

Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on then we will be happy to re-open this issue to pick up where we left off.

@karrtikr karrtikr added the verified Verification succeeded label Apr 26, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-editor-* User-facing catch-all bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster investigating We are looking into the cause of the issue regression Bug didn't exist in a previous release verified Verification succeeded
Projects
None yet
Development

No branches or pull requests