Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 98994

Visual Studio Code Python run section in interactive window not working

$
0
0

When I work on a .py file in Visual Studio Code with python extension, I used to be able to run selected lines in interactive window with Alt+Enter or click on context menu, which is highlighted in the attached screenshot. Recently, it does not work anymore. As far as I know, I did not make any change since the last time I was able to run. The customization in .json file is attached.

Moreover, in the lab pc, I cannot find the action in the context menu. I wonder where to add this to the context menu when I selected lines in the editor and right click at it.

PC Settings:

  • Python Extension: 2020.1.57204

  • Version: 1.41.1 (system setup)

  • Commit: 26076a4de974ead31f97692a0d32f90d735645c0

  • Date: 2019-12-18T14:58:56.166Z

  • Electron: 6.1.5

  • Chrome: 76.0.3809.146

  • Node.js: 12.4.0

  • V8: 7.6.303.31-electron.0

  • OS: Windows_NT x64 10.0.18363

Settings in "settings.json"

{
"files.autoSave": "afterDelay",
"editor.formatOnType": true,
"editor.formatOnSave": true,
"python.linting.flake8Enabled": true,
"python.dataScience.askForKernelRestart": false,
"python.globalModuleInstallation": true,
"python.dataScience.sendSelectionToInteractiveWindow": true
}

All keybindings in Keybindinds.json:

// Place your key bindings in this file to override the defaultsauto[]
[
    {
        "key": "shift+enter",
        "command": "python.datascience.runFileInteractive"
    },
    {
        "key": "shift+enter",
        "command": "-python.datascience.runcurrentcelladvance",
        "when": "editorTextFocus && python.datascience.featureenabled && python.datascience.hascodecells && !editorHasSelection"
    },
    {
        "key": "alt+enter",
        "command": "python.datascience.execSelectionInteractive",
        "when": "editorTextFocus && python.datascience.featureenabled && python.datascience.ownsSelection && !findInputFocussed && !replaceInputFocussed && editorLangId == 'python'"
    },
    {
        "key": "shift+enter",
        "command": "-python.datascience.execSelectionInteractive",
        "when": "editorTextFocus && python.datascience.featureenabled && python.datascience.ownsSelection && !findInputFocussed && !replaceInputFocussed && editorLangId == 'python'"
    },
    {
        "key": "shift+enter",
        "command": "-python.execSelectionInTerminal",
        "when": "editorTextFocus && !findInputFocussed && !python.datascience.ownsSelection && !replaceInputFocussed && editorLangId == 'python'"
    }
]

How do I add this option manually?


Viewing all articles
Browse latest Browse all 98994

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>