前言

工作关系用了很久的ubuntu现在改为windows了,习惯了linux的操作习惯,突然切换到windows上很不习惯。好在有wsl,所以决定在windows下继续使用linux。

如何配置

首先需要wsl,安装ubuntu。可以参考官方的文档安装 WSL
安装wsl2
接着在ubuntu子系统中安装miniconda3,jupyter-notebook,并配置一下jupyter-notebook使用到的浏览器:

下载安装
wget -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.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
安装jupyter notebook
conda install -c conda-forge jupyter notebook
生成jupyter-notebook配置文件
jupyter-notebook --generate-config
重定向ubuntu浏览器到windows的google chrome浏览器
vi ~/.jupyter/jupyter_notebook_config.py
修改
.NotebookApp.use_redirect_file = False
在~/.zshrc添加
export BROWSER='/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe'
source一下~/.zshrc文件,可以使用jupyter-notebook了
source ~/.zshrc

这里jupyter-notebook没有自动打开浏览器,需要我手动拷贝url打开。后面再继续追一下。TODO

Logo

更多推荐