pythonのコードを描こうとjupyter notebookを起動したが、kernelへの接続ができず困っています。
このようになります。
また、コマンドプロンプトにはこのように表示されます。
[W 15:09:40.763 NotebookApp] Notebook Untitled1.ipynb is not trusted
[I 15:09:41.119 NotebookApp] Kernel started: 046a2c82-b7c2-4614-87d7-79eafed4b19f, name: python3
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\tomoh\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\ipykernel_launcher.py", line 16, in <module>
app.launch_new_instance()
File "C:\Users\tomoh\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\traitlets\config\application.py", line 844, in launch_instance
app.initialize(argv)
File "C:\Users\tomoh\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\traitlets\config\application.py", line 87, in inner
return method(app, *args, **kwargs)
File "C:\Users\tomoh\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\ipykernel\kernelapp.py", line 577, in initialize
self.write_connection_file()
File "C:\Users\tomoh\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\ipykernel\kernelapp.py", line 232, in write_connection_file
iopub_port=self.iopub_port, control_port=self.control_port)
File "C:\Users\tomoh\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\jupyter_client\connect.py", line 136, in write_connection_file
with secure_write(fname) as f:
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\contextlib.py", line 112, in enter
return next(self.gen)
File "C:\Users\tomoh\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\jupyter_core\paths.py", line 461, in secure_write
win32_restrict_file_to_user(fname)
File "C:\Users\tomoh\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\jupyter_core\paths.py", line 387, in win32_restrict_file_to_user
import win32api
ImportError: DLL load failed: 指定されたモジュールが見つかりません。
中略
[I 15:09:53.240 NotebookApp] KernelRestarter: restarting kernel (4/5), new random ports
[IPKernelApp] ERROR | Failed to load connection file: 'C:\Users\tomoh\AppData\Roaming\jupyter\runtime\kernel-046a2c82-b7c2-4614-87d7-79eafed4b19f.json'
Traceback (most recent call last):
File "C:\Users\tomoh\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\ipykernel\kernelapp.py", line 257, in init_connection_file
self.load_connection_file()
File "C:\Users\tomoh\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\jupyter_client\connect.py", line 494, in load_connection_file
info = json.load(f)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\json_init.py", line 296, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\json_init.py", line 348, in loads
return _default_decoder.decode(s)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
[W 15:09:56.270 NotebookApp] KernelRestarter: restart failed
[W 15:09:56.271 NotebookApp] Kernel 046a2c82-b7c2-4614-87d7-79eafed4b19f died, removing from map.
[W 15:10:41.175 NotebookApp] Timeout waiting for kernel_info reply from 046a2c82-b7c2-4614-87d7-79eafed4b19f
[E 15:10:41.178 NotebookApp] Error opening stream: HTTP 404: Not Found (Kernel does not exist: 046a2c82-b7c2-4614-87d7-79eafed4b19f)
[W 15:10:42.211 NotebookApp] 404 GET /api/kernels/046a2c82-b7c2-4614-87d7-79eafed4b19f/channels?session_id=3fb79275619f40cd877c19270774d9c6 (::1): Kernel does not exist: 046a2c82-b7c2-4614-87d7-79eafed4b19f
[W 15:10:42.225 NotebookApp] 404 GET /api/kernels/046a2c82-b7c2-4614-87d7-79eafed4b19f/channels?session_id=3fb79275619f40cd877c19270774d9c6 (::1) 17.950000ms referer=None
[W 15:10:44.247 NotebookApp] Replacing stale connection: 046a2c82-b7c2-4614-87d7-79eafed4b19f:3fb79275619f40cd877c19270774d9c6
ググってみたところ、python.exeとjupyterでのkernelのパスが違うと出てきたのですが、
一応そのパスも載せておきます。
python.exe
'C:\Users\tomoh\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe'
kernal
python3 C:\Users\tomoh\AppData\Roaming\jupyter\kernels\python3
あなたの回答
tips
プレビュー