miniconda使用

Posted by DYD on October 25, 2019

docker镜像miniconda使用

docker-miniconda介绍

从docker hub拉取miniconda

docker pull continuumio/miniconda3

进入交互模式

docker run -i -t continuumio/miniconda3 /bin/bash

使用jupyter notebook

docker run -i -t -p 8888:8888 continuumio/miniconda3 /bin/bash -c "/opt/conda/bin/conda install jupyter -y --quiet && mkdir /opt/notebooks && /opt/conda/bin/jupyter notebook --notebook-dir=/opt/notebooks --ip='*' --port=8888 --no-browser"

使用浏览器访问

http://localhost:8888 or http://:8888

手动安装方式

miniconda手动安装

升级环境

conda env update -f environment.yml

激活

conda activate gluon

反激活

conda deactivate

jupyter notebook不能远程访问的问题

生成配置文件

jupyter notebook --generate-config

会写配置文件到: /home/dyd/.jupyter/jupyter_notebook_config.py

jupyter notebook password

会生成密码文件到 ~/.jupyter/jupyter_notebook_config.json 修改py文件,将remote_access访问打开即可。

c.NotebookApp.ip=’*’ #163行

c.NotebookApp.password = u’sha:ce…刚才复制的那个密文’ #217行

c.NotebookApp.open_browser = False#208

c.NotebookApp.port =8888 #可自行指定一个端口, 访问时使用该端口228行

这四条是不是必须的还不知道。现在已可用。

可以参考的方法