为什么在使用ipywidgets选择并上载jupyter笔记本中的文件时,我会获得新的napi_get_last_error_信息?

2024-05-23 16:26:14 发布

您现在位置:Python中文网/ 问答频道 /正文

我在我的Windows10机器上的Visual Studio Code使用了我的Jupyter notebook中的this网站上的文件上载示例。示例如下所示:

    import ipywidgets as widgets
widgets.FileUpload(
    accept='',  # Accepted file extension e.g. '.txt', '.pdf', 'image/*', 'image/*,.pdf'
    multiple=False  # True to accept multiple files upload else False
)

在我的电脑上看起来是这样的:

enter image description here

但是,当我选择任何图像(*.jpg或*.png)或任何文件时,我会在开发人员工具控制台中收到以下错误消息:

FATAL ERROR: Error::New napi_get_last_error_info

workbench.desktop.main.js:1734 Extension host terminated unexpectedly. Code:  134  Signal:  null
_onExtensionHostCrashed @ workbench.desktop.main.js:1734
_onExtensionHostCrashed @ workbench.desktop.main.js:2659
_onExtensionHostCrashOrExit @ workbench.desktop.main.js:1734
(anonymous) @ workbench.desktop.main.js:1734
fire @ workbench.desktop.main.js:55
_onExtHostProcessExit @ workbench.desktop.main.js:2658
(anonymous) @ workbench.desktop.main.js:2658
emit @ events.js:315
ChildProcess._handle.onexit @ internal/child_process.js:275
workbench.desktop.main.js:618   ERR Extension host terminated unexpectedly. The following extensions were running: vscode.microsoft-authentication, vscode.debug-auto-launch, vscode.git, ms-vscode.js-debug, vscode.github, vscode.emmet, vscode.merge-conflict, ms-vscode-remote.remote-wsl-recommender, vscode.testing-editor-contributions, vscode.github-authentication, ms-toolsai.jupyter, ms-python.python





Extension host terminated unexpectedly.
onDidChangeNotification @ workbench.desktop.main.js:738
(anonymous) @ workbench.desktop.main.js:738
fire @ workbench.desktop.main.js:55
addNotification @ workbench.desktop.main.js:740
notify @ workbench.desktop.main.js:1604
prompt @ workbench.desktop.main.js:1604
_onExtensionHostCrashed @ workbench.desktop.main.js:2659
_onExtensionHostCrashOrExit @ workbench.desktop.main.js:1734
(anonymous) @ workbench.desktop.main.js:1734
fire @ workbench.desktop.main.js:55
_onExtHostProcessExit @ workbench.desktop.main.js:2658
(anonymous) @ workbench.desktop.main.js:2658
emit @ events.js:315
ChildProcess._handle.onexit @ internal/child_process.js:275
workbench.desktop.main.js:2658 Extension Host
workbench.desktop.main.js:2658  1: 00007FF7EBEFA256 node::Buffer::New+47254 2: 00007FF7EBEFA455 node::Buffer::New+47765 3: 00007FF7EBEFA289 node::Buffer::New+47305 4: 00007FF7ECA99E45 napi_fatal_error+149 5: 00007FFB712C2B09 napi_register_module_v1+62067 6: 00007FFB712D80F4 napi_register_module_v1+149598 7: 00007FFB712D8725 napi_register_module_v1+151183 8: 00007FFB712ED963 napi_register_module_v1+237773 9: 00007FFB712E48F3 napi_register_module_v1+20079710: 00007FF7ED67340A napi_create_function+114611: 00007FF7EA7EA94E v8::CFunction::CFunction+21201412: 00007FF7EA7E9D96 v8::CFunction::CFunction+20901413: 00007FF7EA7E93E9 v8::CFunction::CFunction+20653714: 00007FF7EA7E9087 v8::CFunction::CFunction+20567115: 00007FF7EB1E7D7C v8_inspector::V8StackTraceId::ToString+349502016: 00007FF7EB179478 v8_inspector::V8StackTraceId::ToString+304215217: 00007FF7EB179478 v8_inspector::V8StackTraceId::ToString+304215218: 00007FF7EB171578 v8_inspector::V8StackTraceId::ToString+300964019: 00007FF7EB237A9B v8_inspector::V8StackTraceId::ToString+382196320: 00007FF7EB199EEE v8_inspector::V8StackTraceId::ToString+317590221: 00007FF7EB176E6C v8_inspector::V8StackTraceId::ToString+303241222: 00007FF7EA8A54F3 v8::Unwinder::PCIsInV8+272323: 00007FF7EA8A5F7F v8::Unwinder::PCIsInV8+542324: 00007FF7EA8A6086 v8::Unwinder::PCIsInV8+568625: 00007FF7EA8CD722 v8::Unwinder::PCIsInV8+16712226: 00007FF7EA8CD4EF v8::Unwinder::PCIsInV8+16655927: 00007FF7EA7EA94E v8::CFunction::CFunction+21201428: 00007FF7EA7E9D96 v8::CFunction::CFunction+20901429: 00007FF7EA7E93E9 v8::CFunction::CFunction+20653730: 00007FF7EA7E9087 v8::CFunction::CFunction+20567131: 00007FF7EB1E7D7C v8_inspector::V8StackTraceId::ToString+349502032: 00007FF7EB179478 v8_inspector::V8StackTraceId::ToString+304215233: 00007FF7EB176F7B v8_inspector::V8StackTraceId::ToString+303268334: 00007FF7EB176B6C v8_inspector::V8StackTraceId::ToString+303164435: 00007FF7EA8A4EA2 v8::Unwinder::PCIsInV8+110636: 00007FF7EA8A4B72 v8::Unwinder::PCIsInV8+29037: 00007FF7EA79C04E v8::Function::Call+36638: 00007FF7EBEAFB7C node::CallbackScope::CallbackScope+206039: 00007FF7EBEAFF1D node::CallbackScope::CallbackScope+298940: 00007FF7EBEC40D2 node::EmitAsyncDestroy+6678641: 00007FF7ED63F048 uv_fs_poll_getpath+1205717642: 00007FF7ED640CAE uv_fs_poll_getpath+1206444643: 00007FF7ECA56369 uv_dlerror+45568944: 00007FF7ECABAF99 uv_pipe_connect+730545: 00007FF7ECABAC70 uv_pipe_connect+649646: 00007FF7EBF1AB55 uv_run+62947: 00007FF7E9475A98 v8::internal::JSMemberBase::JSMemberBase+5584848: 00007FF7E92E13A0 Ordinal0+502449: 00007FF7EF08DB02 uv_random+1806659450: 00007FFB91627034 BaseThreadInitThunk+2051: 00007FFB9273D0D1 RtlUserThreadStart+33

有人知道为什么会这样吗

在运行上述文件上载代码之前,我在PowerShell中安装了以下内容:

pip install Pillow 
pip install scikit-image

看起来两个软件包都成功安装,没有错误消息

我正在运行以下版本的python:

Python 3.7.8 (tags/v3.7.8:4b47a5b6ba, Jun 28 2020, 08:53:46) [MSC v.1916 64 bit (AMD64)] on win32

Tags: nodeinspectormainjsvscodeuvdesktopworkbench