# 1.在linux在使用以下命令下载miniconda
wget -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.sh
# 2.安装刚刚下载的Miniconda,bash就是运行.sh文件的意思
bash Miniconda3-latest-Linux-x86_64.sh
#添加镜像
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
conda config --set show_channel_urls yes
#卸载miniconda
jupyter配置
#conda新建一个环境
conda create -n 环境名字 python=版本
#例如创建一个环境名字为pytorch,python版本为3.7的命令:conda create -n pytorch python=3.7
#激活环境
conda activate 环境名字
#1.安装jupyter
conda install jupyter notebook
#2.配置jupyter远程访问
#生成notebook配置文件
jupyter notebook --generate-config
#打开python,创建一个密文密码
python
from notebook.auth import passwd
passwd()
#输入密码(要输入两次)
exit()
# 修改默认配置文件(将如下内容粘贴到jupyter_notebook_config.py中)
vim ~/.jupyter/jupyter_notebook_config.py
# 插入下面的内容,vim *** 作自行搜索
c.NotebookApp.ip='*'
c.NotebookApp.password=u'argon2:$argon2id$v=19$m=10240,t=10,p=8$OBOjmJ9BxdyrtuY4acfI9g$iwU6g+wQHTNeJJQ0DAjJXjj6azUpJ8oDFvjKxnqxfW' # 下图红框里面内容粘贴于此(每次生成的密文不同)
c.NotebookApp.open_browser=False
c.NotebookApp.port=8888
#运行jupyter notebook
jupyter notebook
#在浏览器中输入 服务器IP地址+端口号 即可通过浏览器远程打开jupyter
#nohup命令可以让服务器在后台运行‘&’符号即为在后台运行
nohup jupyter notebook --allow-root &
#如果要杀死服务可使用如下命令
#先用lsof -i:PID 例如端口号为8888那么命令如下
lsof -i:8888
#然后根据上述指令显示出来的PID杀死进程
kill -9 PID
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)