vscode-python: vscode cannot load Python extension on ssh remote server

Environment data

  • VS Code version: 1.40.2
  • Extension version (available under the Extensions sidebar): 2019.11.50794
  • OS and version: 10.13.5
  • Python version (& distribution if applicable, e.g. Anaconda): Python3.7, Anaconda3.6
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): conda
  • Relevant/affected Python packages and their versions: XXX
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info #3977): XXX

Expected behaviour

The vscode should automatically load the python extension after open a .py file, like following (from my local Mac).

image

Actual behaviour

I found this problem on 1.38, 1.39, 1.40 of vscode.

On ssh remote server, I open a python file (.py). On the bottom, vscode shows that it is activating extension.

image

However, after a few seconds, the activating extension sign disappears, and I cannot edit my code in editor and I cannot type anything in the terminal in vscode. On my Mac, I found that it took several minutes and a lot of computation (from the accelerating cooling fan sound) to activate and load python extension, but eventually it works. So I suspect that it stops working, because it requires too much computation resources to load the Python extension. This doesn’t happen before I updating my vscode.

image

I wonder is that because some issues of new version of python-extension? How can I downgrade my vscode python extension?

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. Open vscode and connect to remote server without open any files. At this point, I can still type command in the terminal in vscode.
  2. When I open a .py file, vscode tries to activate python-extension. Then, everything gets stuck. I cannot type command in terminal and I cannot edit my .py code.

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

[[2019-12-03 11:52:40.504] [exthost] [info] extension host started
[2019-12-03 11:52:40.665] [exthost] [info] ExtensionService#_doActivateExtension GrapeCity.gc-excelviewer {"startup":false,"extensionId":{"value":"GrapeCity.gc-excelviewer","_lower":"grapecity.gc-excelviewer"},"activationEvent":"onLanguage:plaintext"}
[2019-12-03 11:52:40.665] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/user/.vscode-server/extensions/grapecity.gc-excelviewer-2.1.32/dist/extension
[2019-12-03 11:52:40.749] [exthost] [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch {"startup":true,"extensionId":{"value":"vscode.debug-auto-launch","_lower":"vscode.debug-auto-launch"},"activationEvent":"*"}
[2019-12-03 11:52:40.749] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/user/.vscode-server/bin/f359dd69833dd8800b54d458f6d37ab7c78df520/extensions/debug-auto-launch/dist/extension
[2019-12-03 11:52:40.752] [exthost] [info] ExtensionService#_doActivateExtension vscode.emmet {"startup":true,"extensionId":{"value":"vscode.emmet","_lower":"vscode.emmet"},"activationEvent":"*"}
[2019-12-03 11:52:40.752] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/user/.vscode-server/bin/f359dd69833dd8800b54d458f6d37ab7c78df520/extensions/emmet/dist/extension
[2019-12-03 11:52:40.774] [exthost] [info] ExtensionService#_doActivateExtension vscode.git {"startup":true,"extensionId":{"value":"vscode.git","_lower":"vscode.git"},"activationEvent":"*"}
[2019-12-03 11:52:40.774] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/user/.vscode-server/bin/f359dd69833dd8800b54d458f6d37ab7c78df520/extensions/git/dist/main
[2019-12-03 11:52:40.817] [exthost] [info] ExtensionService#_doActivateExtension vscode.merge-conflict {"startup":true,"extensionId":{"value":"vscode.merge-conflict","_lower":"vscode.merge-conflict"},"activationEvent":"*"}
[2019-12-03 11:52:40.817] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/user/.vscode-server/bin/f359dd69833dd8800b54d458f6d37ab7c78df520/extensions/merge-conflict/dist/extension
[2019-12-03 11:52:40.821] [exthost] [info] ExtensionService#_doActivateExtension kisstkondoros.vscode-gutter-preview {"startup":true,"extensionId":{"value":"kisstkondoros.vscode-gutter-preview","_lower":"kisstkondoros.vscode-gutter-preview"},"activationEvent":"*"}
[2019-12-03 11:52:40.821] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/user/.vscode-server/extensions/kisstkondoros.vscode-gutter-preview-0.23.0/dist/extension
[2019-12-03 11:52:40.848] [exthost] [info] ExtensionService#_doActivateExtension natqe.reload {"startup":true,"extensionId":{"value":"natqe.reload","_lower":"natqe.reload"},"activationEvent":"*"}
[2019-12-03 11:52:40.848] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/user/.vscode-server/extensions/natqe.reload-0.0.6/out/extension
[2019-12-03 11:52:40.850] [exthost] [info] eager extensions activated
[2019-12-03 11:53:14.451] [exthost] [info] ExtensionService#_doActivateExtension vscode.python {"startup":false,"extensionId":{"value":"vscode.python","_lower":"vscode.python"},"activationEvent":"onLanguage:python"}
[2019-12-03 11:53:14.451] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/user/.vscode-server/bin/f359dd69833dd8800b54d458f6d37ab7c78df520/extensions/python/dist/pythonMain
[2019-12-03 11:53:14.453] [exthost] [info] ExtensionService#_doActivateExtension ms-python.python {"startup":false,"extensionId":{"value":"ms-python.python","_lower":"ms-python.python"},"activationEvent":"onLanguage:python"}
[2019-12-03 11:53:14.453] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/user/.vscode-server/extensions/ms-python.python-2019.11.50794/out/client/extension
[2019-12-03 11:53:14.770] [exthost] [info] ExtensionService#_doActivateExtension VisualStudioExptTeam.vscodeintellicode {"startup":false,"extensionId":{"value":"VisualStudioExptTeam.vscodeintellicode","_lower":"visualstudioexptteam.vscodeintellicode"},"activationEvent":"onLanguage:python"}
[2019-12-03 11:53:14.770] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/user/.vscode-server/extensions/visualstudioexptteam.vscodeintellicode-1.2.0/dist/intellicode

Adding notes: I looked into relevant issues opened but not addressed yet:

  • Post1: The python language server take too much resources.
  • Post2: Too much resource is used after upgrading the python extension.
  • Post3: Python extension loading pending forever.
  • Post4: Python extension failed to load.

All solutions suggested are either using development version, or uninstall/disable other extensions, or creating a separate issue. However, I tried all of them and none of them works (consistent with what has been said in those posts). I also tried to downgrade the python extension, and use better wifi-network, looks like it can start the process to load python extension, but it cannot finish (python extension loading last forever).

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

XXX

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 16 (7 by maintainers)

Most upvoted comments

Hi Guys, I’m facing the same issues. Please see my logs.

Comments: I’m facing the same issues reported. When I try to work from my local network it works fine. When I try to connect from a wan network I get the results below. I’m able to connect on the remote server, but the Python extension never gets ready.

I deleted de .vscode_server folder from the server and reinstalled the server again, using just the MS python extension. What I noticed from Activity Monitor is that while the python extension was loading the ssh transferred almost 2 gb in and 2gb out. The extension seems to slowly start to activate the functions but it never gets ready. The remote server has a 120mbs connection and I’m a similar connection on the host.

Environment data

  • VS Code version: 1.41.1
  • Extension version (available under the Extensions sidebar): Python 2019.11.50794
  • OS and version: MacOS Catalina 10.15.2 (19C57)
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.7 Anaconda
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): conda
  • Relevant/affected Python packages and their versions: XXX
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info #3977): Language Server

Expected behaviour

Python commands running normally

Actual behaviour

Uploading Captura de Tela 2019-12-21 às 23.21.44.png…

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. Click on the remote explorer
  2. Connect to host (Ubuntu Server 19.10)
  3. Open any .py file

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

Starting Microsoft Python language server.
> conda --version
> pyenv root
> python3.7 -c "import sys;print(sys.executable)"
> python3.6 -c "import sys;print(sys.executable)"
> python3 -c "import sys;print(sys.executable)"
> python2 -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> ~/anaconda3/envs/ndvi/bin/python -c "import sys;print(sys.executable)"
> ~/anaconda3/envs/ndvi/bin/python -m pylint --disable=import-error,missing-module-docstring,invalid-name --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text ~/projetos/ndvi/notebooks/code.py
cwd: ~/projetos/ndvi
> ~/anaconda3/envs/ndvi/bin/python -m pylint --disable=import-error,missing-module-docstring,invalid-name --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text ~/projetos/ndvi/notebooks/code.py
cwd: ~/projetos/ndvi
> ~/anaconda3/envs/ndvi/bin/python -m pycodestyle --format=%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s ~/projetos/ndvi/notebooks/code.py
cwd: ~/projetos/ndvi
> ~/anaconda3/envs/ndvi/bin/python -m pycodestyle --format=%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s ~/projetos/ndvi/notebooks/code.py
cwd: ~/projetos/ndvi
> ~/anaconda3/bin/python ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> ~/anaconda3/bin/python ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> ~/anaconda3/bin/python3 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> ~/anaconda3/bin/python3 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> ~/anaconda3/bin/python3.7 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> ~/anaconda3/bin/python3.7 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /usr/bin/python ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /usr/bin/python ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /usr/bin/python2 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /usr/bin/python2 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /usr/bin/python3 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /usr/bin/python3 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /usr/bin/python3.7 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /usr/bin/python3.7 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /bin/python ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /bin/python ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /bin/python2 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /bin/python2 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /bin/python3 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /bin/python3 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /bin/python3.7 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /bin/python3.7 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /usr/bin/python ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /usr/bin/python ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /usr/bin/python2 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /usr/bin/python2 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /usr/bin/python3 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /usr/bin/python3 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /usr/bin/python3.7 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /usr/bin/python3.7 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /bin/python ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /bin/python ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /bin/python2 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /bin/python2 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /bin/python3 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /bin/python3 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /bin/python3.7 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /bin/python3.7 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
##########Linting Output - pylint##########
************* Module code
5,7,error,syntax-error:invalid syntax (<unknown>, line 5)
##########Linting Output - pycodestyle##########
2,1,E,E266:too many leading '#' for block comment
41,1,E,E303:too many blank lines (3)
281,1,E,E265:block comment should start with '# '
285,9,E,E128:continuation line under-indented for visual indent
288,1,E,E128:continuation line under-indented for visual indent
289,1,E,E128:continuation line under-indented for visual indent
292,1,E,E128:continuation line under-indented for visual indent
293,1,E,E901:TokenError: EOF in multi-line statement
> conda info --json
> ~/anaconda3/bin/python3.7 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> ~/anaconda3/bin/python3.7 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> ~/anaconda3/bin/python3 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> ~/anaconda3/bin/python3 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /usr/bin/python2 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> /usr/bin/python2 ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> ~/anaconda3/bin/python ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> ~/anaconda3/bin/python ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> ~/anaconda3/envs/ndvi/bin/python ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> ~/anaconda3/envs/ndvi/bin/python ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> ~/anaconda3/envs/ndvi/bin/python ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> ~/anaconda3/envs/ndvi/bin/python ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> conda env list
> conda env list
> ~/anaconda3/envs/ndvi/bin/python -m pylint --disable=import-error,missing-module-docstring,invalid-name --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text ~/projetos/ndvi/model/main.py
cwd: ~/projetos/ndvi
> ~/anaconda3/envs/ndvi/bin/python -m pylint --disable=import-error,missing-module-docstring,invalid-name --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text ~/projetos/ndvi/model/main.py
cwd: ~/projetos/ndvi
> ~/anaconda3/envs/ndvi/bin/python -m pycodestyle --format=%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s ~/projetos/ndvi/model/main.py
cwd: ~/projetos/ndvi
> ~/anaconda3/envs/ndvi/bin/python -m pycodestyle --format=%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s ~/projetos/ndvi/model/main.py
cwd: ~/projetos/ndvi
##########Linting Output - pycodestyle##########
3,15,W,W292:no newline at end of file
##########Linting Output - pylint##########
************* Module main
3,0,convention,missing-final-newline:Final newline missing
1,0,warning,unused-import:Unused import sys

------------------------------------------------------------------
Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00)

> ~/anaconda3/envs/ndvi/bin/python -m pylint --disable=import-error,missing-module-docstring,invalid-name --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text ~/projetos/ndvi/notebooks/code.py
cwd: ~/projetos/ndvi
> ~/anaconda3/envs/ndvi/bin/python -m pylint --disable=import-error,missing-module-docstring,invalid-name --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text ~/projetos/ndvi/notebooks/code.py
cwd: ~/projetos/ndvi
> ~/anaconda3/envs/ndvi/bin/python -m pycodestyle --format=%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s ~/projetos/ndvi/notebooks/code.py
cwd: ~/projetos/ndvi
> ~/anaconda3/envs/ndvi/bin/python -m pycodestyle --format=%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s ~/projetos/ndvi/notebooks/code.py
cwd: ~/projetos/ndvi
##########Linting Output - pycodestyle##########
2,1,E,E266:too many leading '#' for block comment
7,5,E,E113:unexpected indentation
9,33,E,E225:missing whitespace around operator
9,48,E,E225:missing whitespace around operator
9,56,E,E225:missing whitespace around operator
15,1,E,E402:module level import not at top of file
16,1,E,E402:module level import not at top of file
17,1,E,E402:module level import not at top of file
19,1,E,E402:module level import not at top of file
20,1,E,E402:module level import not at top of file
21,1,E,E402:module level import not at top of file
22,1,E,E402:module level import not at top of file
24,1,E,E402:module level import not at top of file
25,1,E,E402:module level import not at top of file
26,1,E,E402:module level import not at top of file
27,1,E,E402:module level import not at top of file
28,1,E,E402:module level import not at top of file
41,1,E,E303:too many blank lines (3)
44,80,E,E501:line too long (115 > 79 characters)
45,80,E,E501:line too long (100 > 79 characters)
49,1,E,E265:block comment should start with '# '
63,45,E,E231:missing whitespace after ','
79,80,E,E501:line too long (130 > 79 characters)
111,80,E,E501:line too long (100 > 79 characters)
117,5,W,W291:trailing whitespace
143,80,E,E501:line too long (87 > 79 characters)
161,80,E,E501:line too long (91 > 79 characters)
174,80,E,E501:line too long (112 > 79 characters)
175,80,E,E501:line too long (98 > 79 characters)
241,17,E,E231:missing whitespace after ','
241,19,E,E231:missing whitespace after ','
265,80,E,E501:line too long (97 > 79 characters)
265,98,W,W291:trailing whitespace
276,1,E,E402:module level import not at top of file
277,1,E,E402:module level import not at top of file
281,1,E,E265:block comment should start with '# '
285,9,E,E128:continuation line under-indented for visual indent
288,1,E,E128:continuation line under-indented for visual indent
289,1,E,E128:continuation line under-indented for visual indent
292,1,E,E128:continuation line under-indented for visual indent
293,1,E,E901:TokenError: EOF in multi-line statement
##########Linting Output - pylint##########
************* Module code
5,7,error,syntax-error:invalid syntax (<unknown>, line 5)
> ~/anaconda3/envs/ndvi/bin/python ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py
> ~/anaconda3/envs/ndvi/bin/python ~/.vscode-server/extensions/ms-python.python-2019.11.50794/pythonFiles/interpreterInfo.py