Skip to content

Instantly share code, notes, and snippets.

@syuntoku14
Created June 27, 2019 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save syuntoku14/06419646501c72f6f2835680dc65a7c5 to your computer and use it in GitHub Desktop.
Save syuntoku14/06419646501c72f6f2835680dc65a7c5 to your computer and use it in GitHub Desktop.
Install DL packages
# install python packages
conda config --add channels conda-forge
conda install -y jupyter pytorch torchvision -c pytorch
conda install -y pyvirtualdisplay
yes | pip3 install torchvision
yes | pip3 install gym "gym[atari]"
# Configure jupyter notebook server
jupyter notebook --generate-config
echo "c = get_config()" >> ~/.jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.ip = '0.0.0.0'" >> ~/.jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.open_browser = False" >> ~/.jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.port = 5000" >> ~/.jupyter/jupyter_notebook_config.py
# set jupyter vim extension
pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
mkdir -p $(jupyter --data-dir)/nbextensions
cd $(jupyter --data-dir)/nbextensions
git clone https://github.com/lambdalisue/jupyter-vim-binding vim_binding
jupyter nbextension enable vim_binding/vim_binding
sed -i "/.*Ctrl-C.*:/d" ~/.local/share/jupyter/nbextensions/vim_binding/vim_binding.js
sed -i "/.*'Shift-Esc'.*:/a\ \'Ctrl-C\': CodeMirror.prototype.leaveInsertMode," ~/.local/share/jupyter/nbextensions/vim_binding/vim_binding.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment