【问题标题】:How to fix Jupyter extension activation failed when opening python files?打开python文件时如何修复Jupyter扩展激活失败?
【发布时间】:2021-11-02 10:02:37
【问题描述】:

我最近在我的 macos 系统上安装了 python,当我尝试打开一个 python 文件时,我看到这个关于 Jupyter 扩展的错误弹出窗口:

【问题讨论】:

  • 你运行消息中的命令了吗?
  • 不知道怎么打开的可以在help下找到
  • 你能尝试用另一个版本安装 python 扩展吗?您能否在Output 面板中提供Python 的输出(ViewOutput,将Output 面板右上角的下拉菜单更改为Python)和@987654330 的输出@ 在Developer Tools 面板下(在Help 下打开开发人员工具;通过运行Enable source map support for extension debugging 打开源映射以使任何回溯变得有用)

标签: python visual-studio-code jupyter vscode-extensions


【解决方案1】:

我遇到了同样的问题,终于解决了!


如果您在 Linux 上使用支持 AUR 的基于 Arch 的发行版,只需使用以下命令安装 code-features 软件包:

yay -S code-features

或您选择的任何 AUR 助手。


在其他操作系统上,您应该执行以下操作:

打开你的 VSCode 的product.json。我不知道这个文件在你的操作系统上的什么位置,所以请做一些研究。

查找以下行:

"extensionAllowedProposedApi": [ ...

将以下条目添加到该数组:

"ms-toolsai.jupyter": ["notebookConcatTextDocument", 
    "notebookControllerKind", "notebookDebugOptions", "notebookDeprecated", 
    "notebookEditor", "notebookEditorDecorationType", "notebookEditorEdit", 
    "notebookMessaging", "notebookMime", "notebookCellExecutionState", 
    "portsAttributes", "textDocumentNotebook", "quickPickSortByLabel"]

例如,如果该行最初是:

"extensionAllowedProposedApi": [ "extension1", "extension2" ]

然后改成:

"extensionAllowedProposedApi": [ "extension1", "extension2", 
    "ms-toolsai.jupyter": ["notebookConcatTextDocument", 
    "notebookControllerKind", "notebookDebugOptions", "notebookDeprecated", 
    "notebookEditor", "notebookEditorDecorationType", "notebookEditorEdit", 
    "notebookMessaging", "notebookMime", "notebookCellExecutionState", 
    "portsAttributes", "textDocumentNotebook", "quickPickSortByLabel"] ]

注意,使用第二种方法,每次更新 VSCode 时都需要编辑 product.json

【讨论】:

    猜你喜欢
    • 2023-02-07
    • 1970-01-01
    • 2022-12-18
    • 2020-05-30
    • 2014-08-09
    • 2023-02-14
    • 1970-01-01
    • 2019-05-22
    • 2019-12-08
    相关资源
    最近更新 更多