Vscode-python: command 'python.setInterpreter' not found when using code-server > 3.4.1

Created on 20 Jun 2020  Â·  13Comments  Â·  Source: microsoft/vscode-python

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
area-editor-* needs spike reason-regression type-bug

Most helpful comment

Hi @arseniybanayev, feel free to upvote the issue to help us prioritize it 🙂

All 13 comments

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 : https://github.com/cdr/code-server/issues/1821

The rollback issue was because of a bug which opted users out of experiments. It should be fixed now with https://github.com/microsoft/vscode-python/commit/da85a769070ee785643e7929c8e82db0bd5e1f4a
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.

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

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.

@gauravk88 thanks.

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

Hi @yijingru and @gauravk88,

Can you copy the output for Python in the Output panel (View→Output, 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!

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.

Hi @yijingru and @gauravk88,

Can you copy the output for Python in the Output panel (View→Output, 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

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:

  • Might be related to our DI (see https://github.com/inversify/InversifyJS/issues/729)
  • If running git bisect to build VSIX files and load them, the last working version of the extension was 2020.5.86806, it broke in 2020.6.88468.

Hi @yijingru and @gauravk88,
Can you copy the output for Python in the Output panel (View→Output, 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

why my code-server v3.4.1 + ms-python 2020.5.86806 still get "Debugger Error: The number of constructor arguments in the derived class s must be >= than the number of constructor arguments of its base class."

This is still an issue for me with the latest VSCode that is installed via install.sh and the latest python extension. As suggested, I am rolling back to extension version 5.x and it works.

Hi @arseniybanayev, feel free to upvote the issue to help us prioritize it 🙂

Was this page helpful?
0 / 5 - 0 ratings