sudo apt -y update
sudo apt -y install git
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.profile
# 再読込
source ~/.profile
$ which pyenv
/home/USERNAME/.pyenv/bin/pyenv
sudo pip install numpy scipy matplotlib ipython scikit-learn pandas pillow
sudo pip install jupyter
$ ipython
In [1]: from notebook.auth import passwd
In [2]: passwd()
Enter password: [パスワードを入力]
Verify password: [パスワードを再度入力]
Out[2]: 'sha1: [ハッシュ化されたパスワード]'
$ mkdir ~/.jupyter
$ vim ~/.jupyter/jupyter_notebook_config.py
c = get_config()
# notebook上でplotを表示できるようにする
c.IPKernelApp.pylab = 'inline'
# 全てのIPから接続を許可
c.NotebookApp.ip = '0.0.0.0'
# IPython notebookのログインパスワード
c.NotebookApp.password = 'sha1:[ハッシュ化されたパスワード]'
# 起動時にブラウザを起動させるかの設定
c.NotebookApp.open_browser = False
# ポート指定
c.NotebookApp.port = [接続ポート]
$ jupyter notebook
接続先のURLが表示される [I …] http;//[ip]:[port]/
ctrl + c
表示されたURLにアクセスする 設定したパスを入力してログインすれば使える
jupyterには機能を追加できる 公開されているリポジトリ(公式ではない)
https://github.com/ipython-contrib/IPython-notebook-extensions
apt install python3-pip apt update apt install python3.6 wget https://bootstrap.pypa.io/get-pip.py python3.6 get-pip.py
tkinterがないって言われた https://qiita.com/4hiziri/items/aba80f0bc92300ea22e2
apt install tk-dev
https://qiita.com/kerupani129/items/60ee8c8becc2fe9f0d28 apt update apt install nodejs apt install npm
https://qiita.com/joemphilips/items/de5d12723b9b88b5b090 pip install jupyter