-
-
Notifications
You must be signed in to change notification settings - Fork 0
5_Jupyter
-
[Anaconda Prompt] 관리자 권한으로 실행 (base) C:\Windows\system32> activate machine
-
ipykernel 라이브러리 설치 (machine) C:\Windows\system32>pip install ipykernel
-
jupyter notebook에 가상환경 kernel 추가
- CPU 기반 커널 연동 (machine) C:\Windows\system32>python -m ipykernel install --user --name=machine
- [Anaconda Prompt] 관리자 권한으로 실행
- C:\Windows\System32: 기본 작업 폴더 (base) C:\Windows\system32>jupyter notebook
- 커널 해제 (base) C:\Windows\system32>jupyter kernelspec uninstall machine Kernel specs to remove: machine C:\Users\soldesk\AppData\Roaming\jupyter\kernels\machine
Remove 1 kernel specs [y/N]: y
- 기본 작업 폴더 생성
-
Command 실행
-
Notebook 작업 홈 폴더 생성 C: CD
MD ai_201909 MD ai_201909\ws_python MD ai_201909\ws_python\notebook MD ai_201909\ws_python\notebook\data CD ai_201909\ws_python\notebook\data
폴더 PATH의 목록입니다. 볼륨 일련 번호는 C0EE-2E5F입니다. C:\AI_201909 ├─setup └─ws_python └─notebook └─data
- Jupyter Notebook 실행 파일 생성
- Jupyter Notebook을 실행하는 경로가 기본 작업 폴더로 인식됨.
▷ C:/ai_201909/jupyter.cmd
C:
CD
CD ai_201909
CD ws_python
CD notebook
call activate machine
call Jupyter Notebook
[참고] 만약 특정 경로로 실행되면 Jupyter Notebook 기본 경로의 주석 처리
- 여러명이 Jupyter Notebook 사용시는 폴더 충돌이 발생함으로 아래의 설정을 할것. ▷ C:/Users/soldesk/.jupyter/jupyter_notebook_config.py (Anaconda 4.4.0은 202번 라인, Anaconda 5.1.0 246번 라인) .....
.....
[참고] 기본 작업 폴더의 변경
-
jupyter notebook --generate-config 실행 (base) C:\Users\user>jupyter notebook --generate-config Writing default config to: C:\Users\윈도우계정.jupyter\jupyter_notebook_config.py
-
C:/Users(사용자)/윈도우 로그인 계정/.jupyter/jupyter_notebook_config.py 편집
-
c.NotebookApp.notebook_dir = 'C:/ai_201905/ws_python/notebook' 설정 (246번 라인)
- 폴더 구분자로 \ 사용하면 안됨 ERROR: c.NotebookApp.notebook_dir = 'C:\ai_201905\ws_python\notebook'
-
jupyter notebook 실행 관리자 모드: (base) C:\Windows\system32>jupyter notebook 또는 관리자 모드: C:\Users\soldesk>jupyter notebook
[I 11:27:59.854 NotebookApp] Serving notebooks from local directory: C:/ai_201905/ws_p ython/notebook [I 11:27:59.855 NotebookApp] 0 active kernels [I 11:27:59.855 NotebookApp] The Jupyter Notebook is running at: http://localhos t:8888/?token=7f8b87761f12e45c0f0ddd1efe4d66d4441806e7df220c8a [I 11:27:59.855 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [C 11:27:59.857 NotebookApp]
- Script 생성 및 저장 ▷ /ws_python/notebook/basic/Test.ipynb
import tensorflow as tf
print(tf.version) print("Hello 파이썬")
-
Script 실행 Shift + Enter: 실행후 focus가 다음셀로 이동함. Ctrl + Enter: 실행후 focus가 다음셀로 이동하지 않음.
-
코드 입력후 Tab을 누르면 자동으로 Assist 목록이 출력됨. np.TAB 클릭
Python 3 is a kernel that came with Conda
I added Py
Which is Python 3.6
So use that kernel
If you want to, of course
Okay. All done
Keras, Tensorflow CPU/GPU, lib and Django are installed
jupyter notebook --no-browser --allow-root --ip=0.0.0.0
Although my method of tunneling SSH is more secure because it does not allow anyone else to connect other than you
ssh -N -L localhost:8888:localhost:8888 root@159.89.192.225
And run the notebook like this:
jupyter notebook --no-browser --allow-root
That will keep everything safe and secure... or you can do the --ip=0.0.0.0 and then just connect. Which ever you prefer
create install.sh and requirements.txt
https://github.com/aiegoo/resume/issues/2#issue-549054063
-example on CentOs
yum install git mercurial -y
yum install libXcomposite libXcursor libXi libXtst libXrandr alsa-lib mesa-libEGL libXdamage mesa-libGL libXScrnSaver -y
chmod +x Anaconda3-2019.10-Linux-x86_64.sh
./Anaconda3-2019.10-Linux-x86_64.sh -b -p $HOME/anaconda3 -f
cd Contents/
mv * ../..
mv .gitconfig ../..
mv .gitconfig~ ../..
cd ../..
echo "export PATH=~/anaconda3/bin:$PATH" >> .bashrc
source .bashrc
conda update --all
conda install pip
pip install setuputils typed-ast && pip install --user setuputils typed-ast
pip install ipykernel && pip instal --user ipykernel
python3 -m ipykernel install && python3 -m ipykernel install --user
pip install tensorflow tensorflow-cpu tensorflow-gpu keras lib django pillow && pip install --user tensorflow tensorflow-cpu tensorflow-gpu keras lib django pillow
Home by tonyleekorea jupyterpynative
Day 1 9 lectures
Day 2 6 lectures
-
[Day 2](day2/readme.md)
- 1 function handling
- 2 module package
- 3 ood class
- 4 library Pandas
- 5 lib Matplotlib
- 6 Numpy
- 7 day1 sequential data
- [Tutorial mode](https://github.com/adriantanasa/github-wiki-sidebar/wiki/Usage%3A-Tutorial-mode)
- 2 function global local
- [Command line modifiers](https://github.com/adriantanasa/github-wiki-sidebar/wiki/Usage%3A-Command-line-modifiers)