- windows 11
- wsl2
- Ubuntu 24.04.1 LTS Installer.exe
- rust-1.31.0-x86_64-unknown-linux-gnu.tar.gz
- evcxr_jupyter-v0.20.0-x86_64-unknown-linux-gnu.tar.gz
- Miniconda3-py312_25.1.1-2-Linux-x86_64.sh
/etc/apt/sources.list配置镜像源
deb https://mirrors.aliyun.com/ubuntu/ noble main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ noble main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ noble-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ noble-security main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ noble-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ noble-updates main restricted universe multiverse
# deb https://mirrors.aliyun.com/ubuntu/ noble-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ noble-proposed main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ noble-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ noble-backports main restricted universe multiverse
设置默认wsl子系统为Ubuntu24.04
wsl --set-default Ubuntu-24.04
安装miniconda
chmod +x Miniconda3-py312_25.1.1-2-Linux-x86_64.sh
sh ./Miniconda3-py312_25.1.1-2-Linux-x86_64.sh
添加conda环境变量到.bashrc,并source .bashrc更新
# .bashrc里最末添加
# cmd里面wsl启动默认Ubuntu24.04时切到根目录
cd ~
export PATH="~/miniconda3/bin:$PATH"
# 启动wsl时自动切到下一步创建的虚拟环境
conda activate rustenv
创建conda虚拟环境
conda init
conda create -n rustenv python=3.12
conda activate rustenv
安装Jupyter lab
conda install -c conda-forge jupyterlab
或者使用国内源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
conda install -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main jupyterlab
完全解压到根路径然后安装rust
sh ./rust-1.31.0-x86_64-unknown-linux-gnu/install.sh
添加cargo环境变量到.bashrc
export PATH="~/.cargo/bin:$PATH"
完全解压并安装evcxr_jupyter
evcxr_jupyter --install
运行jupyter lab并选择rust后台
jupyter lab --allow-root
效果
