이 블로그 검색

2017년 11월 9일 목요일

Jupyter Notebook 설치 및 사용 - Ubuntu

IBM PowerAI toolkit 만 설치를 해도 python 2.7 이 자동으로 설치되고 기본적이 라이브러리들이 설치된다.
그래서 Jupyter notebook 도 그냥 실행이 된다. 다만 config 파일을 생성해서 접속 IP 부분을 "*" 로 수정해야 한다.

u0018670/@sys-89538:/$ whcih jupyter
/home/u0018670/.local/bin/jupyter
u0018670/@sys-89538:/$ jupyter notebook --generate-config​
Writing default config to: /home/u0018670/.jupyter/jupyter_notebook_config.py
u0018670/@sys-89538:/$ vi /home/u0018670/.jupyter/jupyter_notebook_config.py
....................
## The IP address the notebook server will listen on.
#c.NotebookApp.ip = 'localhost'
c.NotebookApp.ip = '*'
....................
u0018670/@sys-89538:/$ jupyter notebook
[W 03:12:17.412 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended.
[I 03:12:17.419 NotebookApp] Serving notebooks from local directory: /
[I 03:12:17.419 NotebookApp] 0 active kernels
[I 03:12:17.419 NotebookApp] The Jupyter Notebook is running at:
[I 03:12:17.419 NotebookApp]
http://[all
ip addresses on your system]:8888/?token=14bbfe40057c79cc5150369de56280394095aa32fde6eda5
[I 03:12:17.419 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 03:12:17.420 NotebookApp] No web browser found: could not locate runnable browser.
[C 03:12:17.420 NotebookApp]
    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8888/?token=14bbfe40057c79cc5150369de56280394095aa32fde6eda5

위와 같이 되었다면, 웹브라우저를 통해 해당 서버의 IP주소:port 를 통해 웹브라우저에서 접속이 가능하다. 당연히 위의 token 을 password 를 입력해야한다.



실행된 후, 기본적인 python 코드를 작성 하기위해 new 버튼으로 파일을 한다.
jupyter notebook 따로 config 파일을 설정하지 않으면 실행 된 위치의 디렉토리에 파일을 생성하는데 이때 user 권한의 영향을 받게 되니 주의.
Jupyter notebook 을 통해 tensorflow 소스 코드 작성 및 수행을 위해서는 notebook 을 실행하는 세션에서 tensorflow 를 activate 시키고 notebook 을 실행해야 한다.

댓글 1개:

  1. 내용 잘 봤습니다. 다만 오타가 있습니다. which jupyter로 변경하시면 보시는 분들이 더 도움이 될 것 같습니다.

    답글삭제