I have been trying to install a Rust kernel for a Jupyter server inside a dedicated conda environment but I get errors.
Slighty adjusting steps from:
https://depth-first.com/articles/2020/09/21/interactive-rust-in-a-repl-and-jupyter-notebook-with-evcxr/
conda create -n rusttest
conda activate rusttest
conda install -c conda-forge rust jupyterlab
conda install -c anaconda cmake -y
cargo install evcxr_jupyter
$HOME/.cargo/bin
to my PATH variable (export PATH)evcxr_jupyter --install
(here I already see the kernel is installed outside the env)jupyter lab
The kernel is visible on the dashboard however when I try to start a notebook with it the connection fails and I get:
Error: Failed to find sysroot for Cargo.toml file /tmp/.tmpbZ0Pkw/Cargo.toml. Is rust-src installed?
I have tried manually:
jupyter kernelspec install {MY_PATH_DURING_PKG_INSTALLATION}/Jupyter/kernels/rust --sys-prefix
And I get:
[InstallKernelSpec] Installed kernelspec rust in {MY_PATH}/miniconda3/envs/rusttest/share/jupyter/kernels/rust
Which seems OK (inside the correct conda env) but the error persists.
Is there any way to add a working kernel just to this one jupyter server inside that env?
(I want Rust to be gone when I start jupyter lab
from another conda env)
After digging into this I think the first thing is to get rust-src
installed inside that conda environment... I don't know how...
Solved:
I needed to download https://static.rust-lang.org/dist/2022-05-19/rust-src-1.61.0.tar.gz
manually and extract it under the env dir such that XXX/miniconda3/envs/rusttest/lib/rustlib/src/rust
exists.