주피터 노트북 사용시 kernel error 뜨네요

딥러닝 파이토치 교과서 따라하기 중입니다.

이전에 여기에 올린 질문처럼 파이토치 설치에서 막혀서 힘들었는데

파이토치 정상설치후 주피터 노트북 설치까지 완료후

첫번째 파이토치 예제 확인차

예제 파일을 주피터 노트북에 업로드후

업로드된 파일을 열어보다 보면 위처럼

kernel error가 빨갛게 들어 옵니다.

물론, 교재처럼

  1. 아나콘다 3 64bit 설치
  2. 가상환경 파이톤 3.9.0 으로 설치 conda create-n torch_book python=3.9.0
  3. 가상환경 활성화 activate torch_book
  4. 가상환경에서 커널 설치 pip install ipykernel
    가상환경과 커널 연결 python -m ipykernel install --user --name torch_book --display-name “torch_book”
  5. 파이토치 설치 conda install pytorch==1.9.0 torchvision==0.10.0 torchauio==0.9.0 -c pytorch
  6. 주피터 설치 pip install jupyter notebook
  7. 주피터 실행 jupyter notebook
  8. 주피터 창의 안내대로 웹브라우저 주소창에 해당 주소 입력후 엔터 하면
    웹에서 주피터 실행되고 뜹니다.

  1. 주피터에서 upload 해서 실행시켜볼 예제 업로드후
  2. 업로드한 파일을 더블클릭하면
    뜨는데 kernel error 빨갛게
    물론, kernel 목록에 python3(ipykernel) 과 torch_book 이 있길래
    둘다 해봐도 kernel error가 사라지지는 않는다.

위처럼 해서 문제인가 십어서

new로 새로 만들기 해도
kernel error가 뜬다

failed to start kernel 이란 팝업이 뜨면서 안의 내용은
Traceback (most recent call last):
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\tornado\web.py”, line 1704, in _execute
result = await result
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\tornado\gen.py”, line 769, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\notebook\services\sessions\handlers.py”, line 69, in post
model = yield maybe_future(
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\tornado\gen.py”, line 762, in run
value = future.result()
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\tornado\gen.py”, line 769, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\notebook\services\sessions\sessionmanager.py”, line 98, in create_session
kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\tornado\gen.py”, line 762, in run
value = future.result()
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\tornado\gen.py”, line 769, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\notebook\services\sessions\sessionmanager.py”, line 110, in start_kernel_for_session
kernel_id = yield maybe_future(
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\tornado\gen.py”, line 762, in run
value = future.result()
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\notebook\services\kernels\kernelmanager.py”, line 176, in start_kernel
kernel_id = await maybe_future(self.pinned_superclass.start_kernel(self, **kwargs))
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\jupyter_client\multikernelmanager.py”, line 186, in start_kernel
km.start_kernel(**kwargs)
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\jupyter_client\manager.py”, line 337, in start_kernel
kernel_cmd, kw = self.pre_start_kernel(**kw)
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\jupyter_client\manager.py”, line 286, in pre_start_kernel
self.write_connection_file()
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\jupyter_client\connect.py”, line 466, in write_connection_file
self.connection_file, cfg = write_connection_file(self.connection_file,
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\jupyter_client\connect.py”, line 136, in write_connection_file
with secure_write(fname) as f:
File “C:\anaconda3\lib\contextlib.py”, line 119, in enter
return next(self.gen)
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\jupyter_core\paths.py”, line 461, in secure_write
win32_restrict_file_to_user(fname)
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\jupyter_core\paths.py”, line 387, in win32_restrict_file_to_user
import win32api
ImportError: DLL load failed while importing win32api: 지정된 프로시저를 찾을 수 없습니다.

와 같이 표기가 됩니다.

산넘어 산이네요… 주피터의 kernel error 는 웨문제가 되는지…


혹시나 해서 설치 절차를 아래와 같이 다시 반복해봣습니다.

(base) C:\Users\동환>activate torch_book

(torch_book) C:\Users\동환>pip install ipykernel
Requirement already satisfied: ipykernel in c:\users\동환\appdata\roaming\python\python39\site-packages (6.0.3)
Requirement already satisfied: jupyter-client<7.0 in c:\users\동환\appdata\roaming\python\python39\site-packages (from ipykernel) (6.1.12)
Requirement already satisfied: matplotlib-inline<0.2.0,>=0.1.0 in c:\users\동환\appdata\roaming\python\python39\site-packages (from ipykernel) (0.1.2)
Requirement already satisfied: ipython<8.0,>=7.23.1 in c:\users\동환\appdata\roaming\python\python39\site-packages (from ipykernel) (7.25.0)
Requirement already satisfied: tornado<7.0,>=4.2 in c:\users\동환\appdata\roaming\python\python39\site-packages (from ipykernel) (6.1)
Requirement already satisfied: traitlets<6.0,>=4.1.0 in c:\users\동환\appdata\roaming\python\python39\site-packages (from ipykernel) (5.0.5)
Requirement already satisfied: debugpy<2.0,>=1.0.0 in c:\users\동환\appdata\roaming\python\python39\site-packages (from ipykernel) (1.4.1)
Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in c:\users\동환\appdata\roaming\python\python39\site-packages (from ipython<8.0,>=7.23.1->ipykernel) (3.0.19)
Requirement already satisfied: colorama in c:\users\동환\appdata\roaming\python\python39\site-packages (from ipython<8.0,>=7.23.1->ipykernel) (0.4.4)
Requirement already satisfied: setuptools>=18.5 in c:\anaconda3\envs\torch_book\lib\site-packages (from ipython<8.0,>=7.23.1->ipykernel) (58.0.4)
Requirement already satisfied: jedi>=0.16 in c:\users\동환\appdata\roaming\python\python39\site-packages (from ipython<8.0,>=7.23.1->ipykernel) (0.18.0)
Requirement already satisfied: backcall in c:\users\동환\appdata\roaming\python\python39\site-packages (from ipython<8.0,>=7.23.1->ipykernel) (0.2.0)
Requirement already satisfied: pickleshare in c:\users\동환\appdata\roaming\python\python39\site-packages (from ipython<8.0,>=7.23.1->ipykernel) (0.7.5)
Requirement already satisfied: decorator in c:\users\동환\appdata\roaming\python\python39\site-packages (from ipython<8.0,>=7.23.1->ipykernel) (5.0.9)
Requirement already satisfied: pygments in c:\users\동환\appdata\roaming\python\python39\site-packages (from ipython<8.0,>=7.23.1->ipykernel) (2.9.0)
Requirement already satisfied: parso<0.9.0,>=0.8.0 in c:\users\동환\appdata\roaming\python\python39\site-packages (from jedi>=0.16->ipython<8.0,>=7.23.1->ipykernel) (0.8.2)
Requirement already satisfied: python-dateutil>=2.1 in c:\users\동환\appdata\roaming\python\python39\site-packages (from jupyter-client<7.0->ipykernel) (2.8.2)
Requirement already satisfied: jupyter-core>=4.6.0 in c:\users\동환\appdata\roaming\python\python39\site-packages (from jupyter-client<7.0->ipykernel) (4.7.1)
Requirement already satisfied: pyzmq>=13 in c:\anaconda3\envs\torch_book\lib\site-packages (from jupyter-client<7.0->ipykernel) (22.3.0)
Requirement already satisfied: pywin32>=1.0 in c:\users\동환\appdata\roaming\python\python39\site-packages (from jupyter-core>=4.6.0->jupyter-client<7.0->ipykernel) (301)
Requirement already satisfied: wcwidth in c:\users\동환\appdata\roaming\python\python39\site-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython<8.0,>=7.23.1->ipykernel) (0.2.5)
Requirement already satisfied: six>=1.5 in c:\users\동환\appdata\roaming\python\python39\site-packages (from python-dateutil>=2.1->jupyter-client<7.0->ipykernel) (1.16.0)
Requirement already satisfied: ipython-genutils in c:\users\동환\appdata\roaming\python\python39\site-packages (from traitlets<6.0,>=4.1.0->ipykernel) (0.2.0)

(torch_book) C:\Users\동환>python -n ipykernel install --user --name torch_book --display-name “torch_book”
Unknown option: -n
usage: python [option] … [-c cmd | -m mod | file | -] [arg] …
Try `python -h’ for more information.

(torch_book) C:\Users\동환>python -m ipykernel install --user --name torch_book --display-name “torch_book”
Installed kernelspec torch_book in C:\Users\동환\AppData\Roaming\jupyter\kernels\torch_book

(torch_book) C:\Users\동환>pip install torch==1.9.0 torchvision==0.10.0 torchaudio==0.9.0
Requirement already satisfied: torch==1.9.0 in c:\anaconda3\envs\torch_book\lib\site-packages (1.9.0)
Requirement already satisfied: torchvision==0.10.0 in c:\anaconda3\envs\torch_book\lib\site-packages (0.10.0)
Requirement already satisfied: torchaudio==0.9.0 in c:\anaconda3\envs\torch_book\lib\site-packages (0.9.0)
Requirement already satisfied: typing_extensions in c:\anaconda3\envs\torch_book\lib\site-packages (from torch==1.9.0) (4.1.1)
Requirement already satisfied: numpy in c:\anaconda3\envs\torch_book\lib\site-packages (from torchvision==0.10.0) (1.21.5)
Requirement already satisfied: pillow>=5.3.0 in c:\anaconda3\envs\torch_book\lib\site-packages (from torchvision==0.10.0) (9.0.1)

(torch_book) C:\Users\동환>pip install jupyter notebook
Requirement already satisfied: jupyter in c:\users\동환\appdata\roaming\python\python39\site-packages (1.0.0)
Requirement already satisfied: notebook in c:\users\동환\appdata\roaming\python\python39\site-packages (6.4.0)
Requirement already satisfied: ipywidgets in c:\users\동환\appdata\roaming\python\python39\site-packages (from jupyter) (7.6.3)
Requirement already satisfied: qtconsole in c:\users\동환\appdata\roaming\python\python39\site-packages (from jupyter) (5.1.1)
Requirement already satisfied: jupyter-console in c:\users\동환\appdata\roaming\python\python39\site-packages (from jupyter) (6.4.0)
Requirement already satisfied: ipykernel in c:\users\동환\appdata\roaming\python\python39\site-packages (from jupyter) (6.0.3)
Requirement already satisfied: nbconvert in c:\users\동환\appdata\roaming\python\python39\site-packages (from jupyter) (6.1.0)
Requirement already satisfied: nbformat in c:\users\동환\appdata\roaming\python\python39\site-packages (from notebook) (5.1.3)
Requirement already satisfied: ipython-genutils in c:\users\동환\appdata\roaming\python\python39\site-packages (from notebook) (0.2.0)
Requirement already satisfied: jinja2 in c:\users\동환\appdata\roaming\python\python39\site-packages (from notebook) (3.0.1)
Requirement already satisfied: traitlets>=4.2.1 in c:\users\동환\appdata\roaming\python\python39\site-packages (from notebook) (5.0.5)
Requirement already satisfied: prometheus-client in c:\users\동환\appdata\roaming\python\python39\site-packages (from notebook) (0.11.0)
Requirement already satisfied: argon2-cffi in c:\users\동환\appdata\roaming\python\python39\site-packages (from notebook) (20.1.0)
Requirement already satisfied: terminado>=0.8.3 in c:\users\동환\appdata\roaming\python\python39\site-packages (from notebook) (0.10.1)
Requirement already satisfied: jupyter-client>=5.3.4 in c:\users\동환\appdata\roaming\python\python39\site-packages (from notebook) (6.1.12)
Requirement already satisfied: Send2Trash>=1.5.0 in c:\users\동환\appdata\roaming\python\python39\site-packages (from notebook) (1.7.1)
Requirement already satisfied: tornado>=6.1 in c:\users\동환\appdata\roaming\python\python39\site-packages (from notebook) (6.1)
Requirement already satisfied: jupyter-core>=4.6.1 in c:\users\동환\appdata\roaming\python\python39\site-packages (from notebook) (4.7.1)
Requirement already satisfied: pyzmq>=17 in c:\anaconda3\envs\torch_book\lib\site-packages (from notebook) (22.3.0)
Requirement already satisfied: python-dateutil>=2.1 in c:\users\동환\appdata\roaming\python\python39\site-packages (from jupyter-client>=5.3.4->notebook) (2.8.2)
Requirement already satisfied: pywin32>=1.0 in c:\users\동환\appdata\roaming\python\python39\site-packages (from jupyter-core>=4.6.1->notebook) (301)
Requirement already satisfied: six>=1.5 in c:\users\동환\appdata\roaming\python\python39\site-packages (from python-dateutil>=2.1->jupyter-client>=5.3.4->notebook) (1.16.0)
Requirement already satisfied: pywinpty>=1.1.0 in c:\users\동환\appdata\roaming\python\python39\site-packages (from terminado>=0.8.3->notebook) (1.1.3)
Requirement already satisfied: cffi>=1.0.0 in c:\users\동환\appdata\roaming\python\python39\site-packages (from argon2-cffi->notebook) (1.14.6)
Requirement already satisfied: pycparser in c:\users\동환\appdata\roaming\python\python39\site-packages (from cffi>=1.0.0->argon2-cffi->notebook) (2.20)
Requirement already satisfied: ipython<8.0,>=7.23.1 in c:\users\동환\appdata\roaming\python\python39\site-packages (from ipykernel->jupyter) (7.25.0)
Requirement already satisfied: debugpy<2.0,>=1.0.0 in c:\users\동환\appdata\roaming\python\python39\site-packages (from ipykernel->jupyter) (1.4.1)
Requirement already satisfied: matplotlib-inline<0.2.0,>=0.1.0 in c:\users\동환\appdata\roaming\python\python39\site-packages (from ipykernel->jupyter) (0.1.2)
Requirement already satisfied: pickleshare in c:\users\동환\appdata\roaming\python\python39\site-packages (from ipython<8.0,>=7.23.1->ipykernel->jupyter) (0.7.5)
Requirement already satisfied: colorama in c:\users\동환\appdata\roaming\python\python39\site-packages (from ipython<8.0,>=7.23.1->ipykernel->jupyter) (0.4.4)
Requirement already satisfied: setuptools>=18.5 in c:\anaconda3\envs\torch_book\lib\site-packages (from ipython<8.0,>=7.23.1->ipykernel->jupyter) (58.0.4)
Requirement already satisfied: jedi>=0.16 in c:\users\동환\appdata\roaming\python\python39\site-packages (from ipython<8.0,>=7.23.1->ipykernel->jupyter) (0.18.0)
Requirement already satisfied: pygments in c:\users\동환\appdata\roaming\python\python39\site-packages (from ipython<8.0,>=7.23.1->ipykernel->jupyter) (2.9.0)
Requirement already satisfied: backcall in c:\users\동환\appdata\roaming\python\python39\site-packages (from ipython<8.0,>=7.23.1->ipykernel->jupyter) (0.2.0)
Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in c:\users\동환\appdata\roaming\python\python39\site-packages (from ipython<8.0,>=7.23.1->ipykernel->jupyter) (3.0.19)
Requirement already satisfied: decorator in c:\users\동환\appdata\roaming\python\python39\site-packages (from ipython<8.0,>=7.23.1->ipykernel->jupyter) (5.0.9)
Requirement already satisfied: parso<0.9.0,>=0.8.0 in c:\users\동환\appdata\roaming\python\python39\site-packages (from jedi>=0.16->ipython<8.0,>=7.23.1->ipykernel->jupyter) (0.8.2)
Requirement already satisfied: wcwidth in c:\users\동환\appdata\roaming\python\python39\site-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython<8.0,>=7.23.1->ipykernel->jupyter) (0.2.5)
Requirement already satisfied: widgetsnbextension~=3.5.0 in c:\users\동환\appdata\roaming\python\python39\site-packages (from ipywidgets->jupyter) (3.5.1)
Requirement already satisfied: jupyterlab-widgets>=1.0.0 in c:\users\동환\appdata\roaming\python\python39\site-packages (from ipywidgets->jupyter) (1.0.0)
Requirement already satisfied: jsonschema!=2.5.0,>=2.4 in c:\users\동환\appdata\roaming\python\python39\site-packages (from nbformat->notebook) (3.2.0)
Requirement already satisfied: pyrsistent>=0.14.0 in c:\users\동환\appdata\roaming\python\python39\site-packages (from jsonschema!=2.5.0,>=2.4->nbformat->notebook) (0.18.0)
Requirement already satisfied: attrs>=17.4.0 in c:\users\동환\appdata\roaming\python\python39\site-packages (from jsonschema!=2.5.0,>=2.4->nbformat->notebook) (21.2.0)
Requirement already satisfied: MarkupSafe>=2.0 in c:\users\동환\appdata\roaming\python\python39\site-packages (from jinja2->notebook) (2.0.1)
Requirement already satisfied: defusedxml in c:\users\동환\appdata\roaming\python\python39\site-packages (from nbconvert->jupyter) (0.7.1)
Requirement already satisfied: nbclient<0.6.0,>=0.5.0 in c:\users\동환\appdata\roaming\python\python39\site-packages (from nbconvert->jupyter) (0.5.3)
Requirement already satisfied: entrypoints>=0.2.2 in c:\users\동환\appdata\roaming\python\python39\site-packages (from nbconvert->jupyter) (0.3)
Requirement already satisfied: testpath in c:\users\동환\appdata\roaming\python\python39\site-packages (from nbconvert->jupyter) (0.5.0)
Requirement already satisfied: jupyterlab-pygments in c:\users\동환\appdata\roaming\python\python39\site-packages (from nbconvert->jupyter) (0.1.2)
Requirement already satisfied: pandocfilters>=1.4.1 in c:\users\동환\appdata\roaming\python\python39\site-packages (from nbconvert->jupyter) (1.4.3)
Requirement already satisfied: bleach in c:\users\동환\appdata\roaming\python\python39\site-packages (from nbconvert->jupyter) (3.3.1)
Requirement already satisfied: mistune<2,>=0.8.1 in c:\users\동환\appdata\roaming\python\python39\site-packages (from nbconvert->jupyter) (0.8.4)
Requirement already satisfied: async-generator in c:\users\동환\appdata\roaming\python\python39\site-packages (from nbclient<0.6.0,>=0.5.0->nbconvert->jupyter) (1.10)
Requirement already satisfied: nest-asyncio in c:\users\동환\appdata\roaming\python\python39\site-packages (from nbclient<0.6.0,>=0.5.0->nbconvert->jupyter) (1.5.1)
Requirement already satisfied: packaging in c:\users\동환\appdata\roaming\python\python39\site-packages (from bleach->nbconvert->jupyter) (21.0)
Requirement already satisfied: webencodings in c:\users\동환\appdata\roaming\python\python39\site-packages (from bleach->nbconvert->jupyter) (0.5.1)
Requirement already satisfied: pyparsing>=2.0.2 in c:\users\동환\appdata\roaming\python\python39\site-packages (from packaging->bleach->nbconvert->jupyter) (2.4.7)
Requirement already satisfied: qtpy in c:\users\동환\appdata\roaming\python\python39\site-packages (from qtconsole->jupyter) (1.9.0)

(torch_book) C:\Users\동환>jupyter notebook
[I 2022-04-05 14:00:25.901 LabApp] JupyterLab extension loaded from C:\anaconda3\lib\site-packages\jupyterlab
[I 2022-04-05 14:00:25.901 LabApp] JupyterLab application directory is C:\anaconda3\share\jupyter\lab
[I 14:00:25.911 NotebookApp] Serving notebooks from local directory: C:\Users\동환
[I 14:00:25.911 NotebookApp] Jupyter Notebook 6.4.0 is running at:
[I 14:00:25.911 NotebookApp] http://localhost:8888/?token=2871ec62a769860a295618c97d928da3cfa86b721b97bd07
[I 14:00:25.912 NotebookApp] or http://127.0.0.1:8888/?token=2871ec62a769860a295618c97d928da3cfa86b721b97bd07
[I 14:00:25.913 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 14:00:26.304 NotebookApp]

To access the notebook, open this file in a browser:
    file:///C:/Users/%EB%8F%99%ED%99%98/AppData/Roaming/jupyter/runtime/nbserver-24356-open.html
Or copy and paste one of these URLs:
    http://localhost:8888/?token=2871ec62a769860a295618c97d928da3cfa86b721b97bd07
 or http://127.0.0.1:8888/?token=2871ec62a769860a295618c97d928da3cfa86b721b97bd07

[I 14:01:47.030 NotebookApp] Creating new notebook in
[E 14:01:51.269 NotebookApp] Uncaught exception POST /api/sessions (::1)
HTTPServerRequest(protocol=‘http’, host=‘localhost:8888’, method=‘POST’, uri=’/api/sessions’, version=‘HTTP/1.1’, remote_ip=’::1’)
Traceback (most recent call last):
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\tornado\web.py”, line 1704, in _execute
result = await result
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\tornado\gen.py”, line 769, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\notebook\services\sessions\handlers.py”, line 69, in post
model = yield maybe_future(
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\tornado\gen.py”, line 762, in run
value = future.result()
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\tornado\gen.py”, line 769, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\notebook\services\sessions\sessionmanager.py”, line 98, in create_session
kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\tornado\gen.py”, line 762, in run
value = future.result()
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\tornado\gen.py”, line 769, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\notebook\services\sessions\sessionmanager.py”, line 110, in start_kernel_for_session
kernel_id = yield maybe_future(
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\tornado\gen.py”, line 762, in run
value = future.result()
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\notebook\services\kernels\kernelmanager.py”, line 176, in start_kernel
kernel_id = await maybe_future(self.pinned_superclass.start_kernel(self, **kwargs))
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\jupyter_client\multikernelmanager.py”, line 186, in start_kernel
km.start_kernel(**kwargs)
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\jupyter_client\manager.py”, line 337, in start_kernel
kernel_cmd, kw = self.pre_start_kernel(**kw)
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\jupyter_client\manager.py”, line 286, in pre_start_kernel
self.write_connection_file()
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\jupyter_client\connect.py”, line 466, in write_connection_file
self.connection_file, cfg = write_connection_file(self.connection_file,
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\jupyter_client\connect.py”, line 136, in write_connection_file
with secure_write(fname) as f:
File “C:\anaconda3\lib\contextlib.py”, line 119, in enter
return next(self.gen)
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\jupyter_core\paths.py”, line 461, in secure_write
win32_restrict_file_to_user(fname)
File “C:\Users\동환\AppData\Roaming\Python\Python39\site-packages\jupyter_core\paths.py”, line 387, in win32_restrict_file_to_user
import win32api
ImportError: DLL load failed while importing win32api: 지정된 프로시저를 찾을 수 없습니다.
[W 14:01:51.302 NotebookApp] Unhandled error
[E 14:01:51.306 NotebookApp] {
“Host”: “localhost:8888”,
“Connection”: “keep-alive”,
“Content-Length”: “95”,
“Sec-Ch-Ua”: “” Not A;Brand";v=“99”, “Chromium”;v=“100”, “Google Chrome”;v=“100"”,
“Sec-Ch-Ua-Mobile”: “?0”,
“User-Agent”: “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36”,
“Content-Type”: “application/json”,
“Accept”: “application/json, text/javascript, /; q=0.01”,
“X-Requested-With”: “XMLHttpRequest”,
“X-Xsrftoken”: “2|bd08f007|c4fe2c9bd1ed8595d4ce5d568a9a69c0|1649122830”,
“Sec-Ch-Ua-Platform”: ““Windows””,
“Origin”: “http://localhost:8888”,
“Sec-Fetch-Site”: “same-origin”,
“Sec-Fetch-Mode”: “cors”,
“Sec-Fetch-Dest”: “empty”,
“Referer”: “http://localhost:8888/notebooks/Untitled4.ipynb?kernel_name=torch_book”,
“Accept-Encoding”: “gzip, deflate, br”,
“Accept-Language”: “ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7”,
“Cookie”: “_xsrf=2|bd08f007|c4fe2c9bd1ed8595d4ce5d568a9a69c0|1649122830; username-localhost-8888=“2|1:0|10:1649134889|23:username-localhost-8888|44:MDM1YWU4MDBiOWMwNDdjMmI3Mzc1MWU0NTYwYjYwMzI=|f0936a4515ca10a1459faa46359c900cd63160ef5b2d3306317d311858043c2b””
}
[E 14:01:51.309 NotebookApp] 500 POST /api/sessions (::1) 145.000000ms referer=http://localhost:8888/notebooks/Untitled4.ipynb?kernel_name=torch_book
[I 14:03:51.184 NotebookApp] Saving file at /Untitled4.ipynb

위처럼…문제 없었습니다.

주피터 실행은

To access the notebook, open this file in a browser:
    file:///C:/Users/%EB%8F%99%ED%99%98/AppData/Roaming/jupyter/runtime/nbserver-24356-open.html
Or copy and paste one of these URLs:
    http://localhost:8888/?token=2871ec62a769860a295618c97d928da3cfa86b721b97bd07
 or http://127.0.0.1:8888/?token=2871ec62a769860a295618c97d928da3cfa86b721b97bd07

위 3줄의 문구중 file:///C:/Users/%EB%8F%99%ED%99%98/AppData/Roaming/jupyter/runtime/nbserver-24356-open.htm를 주소창에서 실행하거나

http://localhost:8888/?token=2871ec62a769860a295618c97d928da3cfa86b721b97bd07를
웹브라우저의 주소창에서 입력하여 실행하면

주피터 노트북은 깔끔히 뜨나…

문제는 새로운 파일을 만들거나 기존 업로드한것을 더블클릭해서 실행하려면
kernel error가 빨갛게 불이 들어 와있음…

한가지 궁금한것은 예전에 주피터 노트북 실행시킬때는 이렇게 걸거치게 주소 창에 입력하지 않고
바로 주피터 창이 뜬거 같은데…왜 지금은 안그런지?

그리고 코딩하다가

창을 닫고 다시 처음부터 시작하려고 하면서
conda env list 로
확인해보면
왜 좀전에 activate 된 torch_book 이 아니고
기본 이 activate가 되어있는지…

그러다보니 매번 activate torch_book을 해야 하는데
여간 귀찮은게 아니어서요…