question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The extension can not be activated because of the wrong path of python2.7

See original GitHub issue

Issue Type: Bug

Expected vs. Actual

v2022.0.1814523869 could not be activated normally on my Macbook M1 Max, while v2021.12.1559732655 works fine. It can be seen from logs that v2022.0.1814523869 uses /usr/lib/python2.7 rather than /usr/bin/python2.7.

The error information obtained from logs:

[ERROR 2022-1-18 14:15:50.216]: [Error: Command failed: /usr/lib/python2.7 /Users/euruson/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py /Users/euruson/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py
/bin/sh: /usr/lib/python2.7: is a directory

	at ChildProcess.exithandler (child_process.js:317:12)
	at ChildProcess.emit (events.js:315:20)
	at maybeClose (internal/child_process.js:1048:16)
	at Socket.<anonymous> (internal/child_process.js:439:11)
	at Socket.emit (events.js:315:20)
	at Pipe.<anonymous> (net.js:673:12)] {
  killed: false,
  code: 126,
  signal: null,
  cmd: '/usr/lib/python2.7 /Users/euruson/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py /Users/euruson/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py'
}

Steps to reproduce:

  1. Install the version of v2022.0.1814523869 on macOS 12.2.1.

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.9.7
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Conda
  • Value of the python.languageServer setting: Default
User Settings


defaultLS: {"defaultLSType":"Pylance"}

downloadLanguageServer: true

envFile: "<placeholder>"

venvPath: "<placeholder>"

venvFolders: "<placeholder>"

condaPath: "<placeholder>"

pipenvPath: "<placeholder>"

poetryPath: "<placeholder>"

languageServer: "Pylance"

linting
• enabled: true
• cwd: "<placeholder>"
• Flake8Args: "<placeholder>"
• flake8Enabled: true
• flake8Path: "<placeholder>"
• lintOnSave: true
• banditArgs: "<placeholder>"
• banditEnabled: false
• banditPath: "<placeholder>"
• mypyArgs: "<placeholder>"
• mypyEnabled: false
• mypyPath: "<placeholder>"
• pycodestyleArgs: "<placeholder>"
• pycodestyleEnabled: false
• pycodestylePath: "<placeholder>"
• prospectorArgs: "<placeholder>"
• prospectorEnabled: false
• prospectorPath: "<placeholder>"
• pydocstyleArgs: "<placeholder>"
• pydocstyleEnabled: false
• pydocstylePath: "<placeholder>"
• pylamaArgs: "<placeholder>"
• pylamaEnabled: false
• pylamaPath: "<placeholder>"
• pylintArgs: "<placeholder>"
• pylintPath: "<placeholder>"

sortImports
• args: "<placeholder>"
• path: "<placeholder>"

formatting
• autopep8Args: "<placeholder>"
• autopep8Path: "<placeholder>"
• provider: "black"
• blackArgs: "<placeholder>"
• blackPath: "<placeholder>"
• yapfArgs: "<placeholder>"
• yapfPath: "<placeholder>"

testing
• cwd: "<placeholder>"
• debugPort: 3000
• nosetestArgs: "<placeholder>"
• nosetestsEnabled: undefined
• nosetestPath: "<placeholder>"
• promptToConfigure: true
• pytestArgs: "<placeholder>"
• pytestEnabled: false
• pytestPath: "<placeholder>"
• unittestArgs: "<placeholder>"
• unittestEnabled: false
• autoTestDiscoverOnSaveEnabled: true

terminal
• activateEnvironment: true
• executeInFileDir: "<placeholder>"
• launchArgs: "<placeholder>"

experiments
• enabled: true
• optInto: []
• optOutFrom: []

insidersChannel: "off"

tensorBoard
• logDirectory: "<placeholder>"

Extension version: 2022.0.1814523869 VS Code version: Code 1.64.2 (Universal) (f80445acd5a3dadef24aa209168452a3d97cc326, 2022-02-09T22:00:58.347Z) OS version: Darwin arm64 21.3.0 Restricted Mode: No

System Info
Item Value
CPUs Apple M1 Max (10 x 24)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 12, 12, 8
Memory (System) 32.00GB (12.57GB free)
Process Argv –crash-reporter-id 0bc367ad-56d2-4c36-82b8-024cb5c87f13
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392cf:30425750
pythontb:30283811
pythonptprofiler:30281270
vsdfh931cf:30280410
vshan820:30294714
vstes263:30335439
vscorecescf:30438341
pythondataviewer:30285071
vscod805cf:30301675
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
vsc1dst:30438360
pythonvs932:30410667
wslgetstartedc:30433508
vsclayoutctrc:30437038
vsrem710cf:30416617
dsvsc009:30440023
pythonvspyt640:30436486
vsbas813:30436447
vscscmwlcmt:30438805
helix:30440343

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:11

github_iconTop GitHub Comments

2reactions
roxberrycommented, Mar 9, 2022

Same error here. Would that prevent the status bar extension from being available? I no longer can change the interpreter from the IDE. Also, syntax coloring may be affected. Unsure if there are other side effects. I downgraded to v2021.11.1422169775 and the interpreter selector is back in the status bar.

Current Version

Experiment ‘pythonInterpreterInfoUnpinned’ is active

conda info --json /usr/bin/python3 ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py /usr/bin/python ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py /usr/lib/python2.7 ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py Python interpreter path: /usr/bin/python3 [ERROR 2022-1-22 19:14:4.308]: [Error: Command failed: /usr/lib/python2.7 /Users/mroxberry/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py /Users/mroxberry/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py /bin/sh: /usr/lib/python2.7: is a directory

at ChildProcess.exithandler (child_process.js:317:12)
at ChildProcess.emit (events.js:315:20)
at maybeClose (internal/child_process.js:1048:16)
at Socket.<anonymous> (internal/child_process.js:439:11)
at Socket.emit (events.js:315:20)
at Pipe.<anonymous> (net.js:673:12)] {

killed: false, code: 126, signal: null, cmd: ‘/usr/lib/python2.7 /Users/mroxberry/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py /Users/mroxberry/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py’ }

v2021.11.1422169775

Experiment ‘pythonaacf’ is active Experiment ‘pythonTensorboardExperiment’ is active Experiment ‘pythonSurveyNotificationcf’ is active Experiment ‘PythonPyTorchProfiler’ is active Experiment ‘pythonDeprecatePythonPath’ is active Experiment ‘pythonInterpreterInfoUnpinned’ is active

conda info --json /usr/bin/python ~/.vscode/extensions/ms-python.python-2021.11.1422169775/pythonFiles/interpreterInfo.py /usr/bin/python3 ~/.vscode/extensions/ms-python.python-2021.11.1422169775/pythonFiles/interpreterInfo.py /usr/lib/python2.7 ~/.vscode/extensions/ms-python.python-2021.11.1422169775/pythonFiles/interpreterInfo.py Python interpreter path: /usr/bin/python3 Starting Pylance language server. conda --version

0reactions
karrtikrcommented, Mar 9, 2022

Looks like most of users in this thread were thinking extension did not activate because of https://github.com/microsoft/vscode-python/issues/18283. Closing this thread.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I change the Python version in Visual Studio Code?
File -> Preferences -> Settings · Type in "python.pythonPath" in the search bar. · Change it to what you normally run python with...
Read more >
Debugging configurations for Python apps in Visual Studio Code
The Python extension supports debugging of several types of Python applications. ... the simplest way is to select the down-arrow next to the...
Read more >
Using pip to install Python 2 modules
After you've created and activated your virtualenv, you may see the following error when installing packages with pip. SNIMissingWarning: An ...
Read more >
sys — System-specific parameters and functions
This module provides access to some variables used or maintained by the interpreter and to functions that interact strongly with the interpreter. It...
Read more >
Install Python, pip, and the EB CLI on Linux
If Python 2.7 or later isn't installed, install Python 3.7 using your ... command instead of python ensures that pip is installed in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found