- 참고 블로그:
- http://freeprog.tistory.com/63
- http://webnautes.tistory.com/799
- http://blog.danggun.net/4069
- https://machinelearningmastery.com/setup-python-environment-machine-learning-deep-learning-anaconda/
설치 방법1 : pip를 이용해서 설치하는 방식$ sudo apt-get update$ sudo apt-get install python-pip$ pip list$ sudo pip install -U numpy(만약 필요하다면 다음을 먼저 수행)$ sudo apt-get install python-dev$ sudo apt-get install libblas-dev liblapack-dev$ sudo pip install -U scipy(만약 필요하다면 다음을 먼저 수행)$ sudo apt-get install gfortran$ sudo apt-get install libpng-dev libfreetype6-dev libjpeg8-dev$ sudo pip install matplotlib$ sudo pip install -U scikit-learn$ sudo pip install jupyter(만약 설치후 jupyter가 실행되지 않는다면 다음과 같이 해보기)$ ~/.local/bin/jupyter-notebook상기 명령이 먹힌다면, ~/.bashrc 에 다음 문장 넣어서 구동하기 export PATH=$PATH:~/.local/bin그런데, 지금까지 주욱 잘 설치가 되도, 막상 jupyter 구동하면, kernel 찾을 수 없다는 메시지 나올 수 있음- 설치 방법2: anaconda3을 이용해서 쉽게 설치
- 참고 사이트
- 윈도우 기준 설명: http://agiantmind.tistory.com/172
- https://ipython.readthedocs.io/en/latest/install/kernel_install.html
- 다음의 사이트에서 원하는 버전의 python installer 선택하여 다운로드
- https://www.continuum.io/downloads
- $ bash Anaconda3-4.3.1-Linux-x86_64.sh
- 기본적으로 /home/user/anaconda3 에 설치된다.
- 기본적인 conda 명령들
- 참고: https://conda.io/docs/test-drive.html
- $ conda update --help
- $ conda --version
- $ conda update conda
- $ conda info --envs
- $ conda list
- exercise
- $ conda create --name eclc
python=3.5ipykernel - $ conda install --name eclc numpy pandas matplotlib scipy pip
- $ conda info --envs
- $ source activate eclc
- $ python -m ipykernel install --user --name eclc --display-name "Python3.5 (eclc)"
- $ source deactivate
- $ conda remove --name eclc --all
- $ jupyter notebook
- packages
- pip install 대신에 conda install 을 사용할 것.
- pip는 anaconda 패키지 위치에 설치되는 것이 아니라 기본 System 패키지 설치 위치에 설치됨
- 필요한 경우, conda install로 pip를 설치한 뒤, 해당 env에서 pip로 설치
- $ conda install -n eclc pip
- $ source activate eclc
- $ pip install emcee corner
- 기타
- virtualenv가 필요한 경우
- sudo pip install virtualenv
- pip list 구동시 ImportError 나올 때
- $ sudo apt-get purge -y python-pip
- $ wget https://bootstrap.pypa.io/get-pip.py
- $ sudo python ./get-pip.py
- $ sudo apt-get install python-pip
- Jupyter 다중 kernel 설정
- $ jupyter kernelspec list
- pytorch 설치 방법
- $ conda install pytorch torchvision cuda80 -c soumith
- Checking versions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# scipy
import scipy
print('scipy: %s' % scipy.__version__)
# numpy
import numpy
print('numpy: %s' % numpy.__version__)
# matplotlib
import matplotlib
print('matplotlib: %s' % matplotlib.__version__)
# pandas
import pandas
print('pandas: %s' % pandas.__version__)
# statsmodels
import statsmodels
print('statsmodels: %s' % statsmodels.__version__)
# scikit-learn
import sklearn
print('sklearn: %s' % sklearn.__version__)
# tensorflow
import tensorflow
print('tensorflow: %s' % tensorflow.__version__)
# keras
import keras
print('keras: %s' % keras.__version__)
| cs |
- Tensorflow 설치하기
- 참고사이트:
- https://www.tensorflow.org/install/install_linux
- https://www.tensorflow.org/install/install_linux#the_url_of_the_tensorflow_python_package
- $ source activate eclc
- $ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.1-cp35-cp35m-linux_x86_64.whl
- GPU 기반으로 설치하기 위한 노력:
- 만약 pycharm 등 외부 IDE에서 tensorflow가 import 되지 않는다면, Settings>Project Interpreter 설정을 anaconda3/envs 아래의 적정한 python 실행기로 변경 설정하면 됨.
- Jupyter, Python
- Reproducible Data Analysis in Jupyter:
- https://jakevdp.github.io/blog/2017/03/03/reproducible-data-analysis-in-jupyter/?imm_mid=0ef31d&cmp=em-data-na-na-newsltr_20170322
- Jupyter와 python을 이용하는 친절한 데이터 분석 튜토리얼 & 동영상.
- Jupyter Notebook Tutorial: The Definitive Guide
- Jupyter resources
- 나름 유명한 예제들
- Python Quickstart
- Free python books
- Python 추천 도서
- Python Essential Reference (David Beazley, 2009, 4판): (2017년 5판 작업 시작). 처음 200페이지 정도가 핵심. 뒤쪽 500페이지는 레퍼런스.
- Fluent Python (Luciano Ramalho, 2015): 효율적인 개념 이해.
- Python Cookbook: 2판은 개념 설명, 3판(2013)은 python 3.3에 집중.
- Python 기반 병렬 프로그래밍 설명 블로그
- Numpy tutorial (Stanford)