Last active
September 3, 2024 17:37
-
-
Save korakot/ae95315ea6a3a3b33ee26203998a59a3 to your computer and use it in GitHub Desktop.
Install rust, cargo in Colab
This file contains 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 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
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.