【问题标题】:CodeOSS not running python filesCodeOSS 没有运行 python 文件
【发布时间】:2023-01-11 08:47:32
【问题描述】:

几个星期以来,我的 Code-OSS 一直没有运行我的 python 脚本。我正在运行 Garuda linux 发行版,我的 Code-OSS 版本为 1.74.2-1,我的 python 版本为 3.10.9-1。每当我尝试运行以前工作的 .py 文件或创建新文件时,都会弹出一个错误:“扩展激活失败,运行‘开发人员:切换开发人员工具’命令以获取更多信息。”以及不确定地显示 python 扩展加载。切换开发人员工具并尝试创建新的 python 文件后,显示以下错误:

mainThreadExtensionService.ts:111 Activating extension 'ms-python.python' failed: Extension 'ms-python.python' CANNOT use API proposal: telemetryLogger.
Its package.json#enabledApiProposals-property declares:  but NOT telemetryLogger.
 The missing proposal MUST be added and you must start in extension development mode or use the following command line switch: --enable-proposed-api ms-python.python.
$onExtensionActivationError @ mainThreadExtensionService.ts:111
listWidget.ts:803 List with id 'list_id_2' was styled with a non-opaque background color. This will break sub-pixel antialiasing.
style @ listWidget.ts:803
log.ts:316   ERR command 'python.createNewFile' not found: Error: command 'python.createNewFile' not found
    at b.k (vscode-file://vscode-app/usr/lib/code/out/vs/workbench/workbench.desktop.main.js:1669:3069)
    at b.executeCommand (vscode-file://vscode-app/usr/lib/code/out/vs/workbench/workbench.desktop.main.js:1669:2985)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async vscode-file://vscode-app/usr/lib/code/out/vs/workbench/workbench.desktop.main.js:1740:4663
log.ts:316   ERR command 'python.createNewFile' not found: Error: command 'python.createNewFile' not found
    at b.k (vscode-file://vscode-app/usr/lib/code/out/vs/workbench/workbench.desktop.main.js:1669:3069)
    at b.executeCommand (vscode-file://vscode-app/usr/lib/code/out/vs/workbench/workbench.desktop.main.js:1669:2985)
    at async vscode-file://vscode-app/usr/lib/code/out/vs/workbench/workbench.desktop.main.js:1740:4663
log.ts:316   ERR command 'python.createNewFile' not found: Error: command 'python.createNewFile' not found
    at b.k (vscode-file://vscode-app/usr/lib/code/out/vs/workbench/workbench.desktop.main.js:1669:3069)
    at b.executeCommand (vscode-file://vscode-app/usr/lib/code/out/vs/workbench/workbench.desktop.main.js:1669:2985)
    at async vscode-file://vscode-app/usr/lib/code/out/vs/workbench/workbench.desktop.main.js:1740:4663

我现在一直在为此苦苦挣扎,想问问是否有人知道该怎么做?提前非常感谢您,请原谅可能出现的错误格式,因为我还不知道如何正确地做到这一点。

我多次尝试重新安装 Code-OSS 包,以及重新安装 python 和扩展,但都没有用。

【问题讨论】:

    标签: python visual-studio


    【解决方案1】:

    尝试像这样运行 code-OSS:

    /usr/bin/code-oss --enable-proposed-api ms-python.python --unity-launch %F

    重要的部分是:--enable-proposed-api ms-python.python

    如果您使用的是桌面环境,只需编辑启动器即可。希望这可以帮助

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-02
      • 2021-03-19
      • 1970-01-01
      • 2021-12-24
      • 2021-01-13
      • 1970-01-01
      • 2016-11-23
      • 1970-01-01
      相关资源
      最近更新 更多