□ 환경

- Windows, Ubuntu 공통

- python 3.7 이상

 

python 환경이 먼저 설치가 되어 있어야 한다.

 

Jupyter notebook이 설치가 되어 있지 않다면, 아래 명령으로 간단히 설치가 가능하다.

pip3 install jupyter

 

이후 하기 명령으로 간단히 띄우는 것이 가능하다.

python.exe -m notebook

 

C:\workspace>python -m notebook

[W 2024-02-07 10:21:11.326 ServerApp] A `_jupyter_server_extension_points` function was not found in notebook_shim. Instead, a `_jupyter_server_extension_paths` function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
[I 2024-02-07 10:21:11.329 ServerApp] jupyter_lsp | extension was successfully linked.

.....

    Or copy and paste one of these URLs:
        http://localhost:8888/tree?token=5d77610764e494f4a70849088e4713459b1fad22e87706cd
        http://127.0.0.1:8888/tree?token=5d77610764e494f4a70849088e4713459b1fad22e87706cd

.....

0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.

 

실행하면 위와 같은 로그가 출력되며 이 중 copy and paste of these URLs: 란 문구 아래 둘 중 하나를 사용해서 브라우저 상에서 jupyter notebook을 띄우는 게 가능하다. 

copy and paste of these URLs:

      http://localhost:8888/tree?token=5d77610764e494f4a70849088e4713459b1fad22e87706cd
      http://127.0.0.1:8888/tree?token=5d77610764e494f4a70849088e4713459b1fad22e87706cd

 

반응형

주피터 노트북 설치 시 

'notebook': [Errno 2] No such file or directory

오류가 발생하는 경우가 있다.  해당 오류가 발생하면 아무하는 일없이 하루 정도 워프는 순간이다.

아침에 발생하면 밤새 이것만 붙들어야하는 .... 


해당 오류는 아래와 같이 수행하는 경우 해결된다.

다만, 워낙 case by case라 다 통하는 것은 아니다.

그러나, 대게 아래 1)번만 수행해도 해결되고 안되면 3)번까지 수행했을 때 종종 잘 해결된다.



1) Jupyter notebook 강제 설치 명령

 # For Python 2

 pip install --upgrade --force-reinstall --no-cache-dir jupyter


 # For Python 3

 pip3 install --upgrade --force-reinstall --no-cache-dir jupyter


2) [Optional] Notebook을 uninstall 한다.

 # For Python 2

 sudo pip uninstall notebook


 # For Python 3

 sudo pip3 uninstall notebook


3) Notebook reinstall 한다.

 # For Python 2

  sudo pip install --upgrade notebook


 # For Python 3

  sudo pip3 install --upgrade notebook 





반응형

'Linux' 카테고리의 다른 글

How can I install CUDA 9 on Ubuntu 17.10  (0) 2018.07.20
Ubuntu Synergy 설치  (0) 2018.07.20
conda vs. pip vs. virtualenv  (0) 2018.02.03
VIM 에디터 VIMRC 세팅  (0) 2018.02.03
COMODO vaccine - Filesystem filter driver is not loaded 패치  (0) 2018.01.21

 

□ Jupyter notebook 명령키 일람

 

Command Mode (press Esc to enable) Edit Mode (press Enter to enable)
Enter   enter edit mode Tab   code completion or indent
Shift-Enter   run cell, select below Shift-Tab   tooltip
Ctrl-Enter   run cell Ctrl-]   indent
Alt-Enter   run cell, insert below Ctrl-[   dedent
Y   to code Ctrl-A   select all
M   to markdown Ctrl-Z   undo
R   to raw Ctrl-Shift-Z   redo
1  to heading 1 Ctrl-Y   redo
2  to heading 2 Ctrl-Home   go to cell start
3  to heading 3 Ctrl-Up   go to cell start
4  to heading 4 Ctrl-End   go to cell end
5  to heading 5 Ctrl-Down   go to cell end
6  to heading 6 Ctrl-Left   go one word left
Up   select cell above Ctrl-Right   go one word right
K   select cell above Ctrl-Backspace   delete word before
Down   select cell below Ctrl-Delete   delete word after
J   select cell below Esc   command mode
A   insert cell above Ctrl-M   command mode
B   insert cell below Shift-Enter   run cell, select below
X   cut selected cell Ctrl-Enter   run cell
C   copy selected cell Alt-Enter   run cell, insert below
Shift-V   paste cell above Ctrl-Shift-Subtract   split cell
V   paste cell below Ctrl-Shift--   split cell
Z   undo last cell deletion Ctrl-S   Save and Checkpoint
D,D   delete selected cell Up   move cursor up or previous cell
Shift-M   merge cell below Down   move cursor down or next cell
S   Save and Checkpoint Shift   ignore
Ctrl-S   Save and Checkpoint
L   toggle line numbers
O   toggle output
Shift-O   toggle output scrolling
Esc   close pager
Q   close pager
H   show keyboard shortcut help
I,I   interrupt kernel
0,0   restart kernel
Space   scroll down
Shift-Space   scroll up
Shift   ignore

 

□ 기타 명령 모음

  - ipynb 파일 → py 파일 변환

    콘솔창에서 아래 명령 수행


    jupyter nbconvert --to script [파일명].ipynb



반응형

+ Recent posts