Last active
April 2, 2025 14:08
-
-
Save korakot/ae95315ea6a3a3b33ee26203998a59a3 to your computer and use it in GitHub Desktop.
Install rust, cargo in Colab
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run this once, then reload, and then skip this | |
!apt install rustc | |
!gdown --id 1PULtTc-2e9z4bswh_SQqL5oy_4JpfV7c | |
!chmod +x evcxr_jupyter | |
!./evcxr_jupyter --install | |
// install dependency | |
:dep cmd_lib | |
use cmd_lib::run_cmd as sh; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# just to use with python | |
!apt install rustc | |
%env USER=korakot |
Many thanks to @mateusvmv efforts and friends here in this discussion. I put together a bash script that overwrites the current kernel and spins up a new Rust kernel without manual config:
# This script sets up and spins up a Jupyter Notebook environment with a Rust kernel using Nix and IPC Proxy.
!wget -qO- https://gist.github.com/wiseaidev/2af6bef753d48565d11bcd478728c979/archive/3f6df40db09f3517ade41997b541b81f0976c12e.tar.gz | tar xvz --strip-components=1
!bash setup_evcxr_kernel.sh
@wiseaidev in hands at these lines for me:
Installation complete
bc102165f43db4ebd84fcdb4c5bfb129-b087c21310402bc999b36fecaf63207c74cf5b90/install_ipc_proxy_kernel.py
bc102165f43db4ebd84fcdb4c5bfb129-b087c21310402bc999b36fecaf63207c74cf5b90/ipc_proxy_kernel.py
is it supposed to still work?
is it supposed to still work?
yep, run it once, switch kernel to Rust (not Rust-TCP), then reconnect
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Managed to run evcxr by proxying the IPC connection to TCP, as it expects. It needs both cargo and rustc installed, and they can be installed via apt, which is faster. Below is code which uses nix instead of apt to install most of the stuff: run once, change runtime and restart.