Setting Up a Clean Python + Rust Practice Environment

Goal: Create a simple, organized system that makes it easy to switch between practicing Python and Rust on the same machine.

1. Check if Rust is installed

Bash

rustc --version
cargo --version

If both commands return version numbers, Rust is ready.

2. Create a clean folder structure

Bash

mkdir -p ~/python_practice
mkdir -p ~/rust_projects

Final structure:

text

~
├── python_practice/          # Python experiments
└── rust_projects/
    ├── polars_test/          # Polars practice project
    └── rust_ai/              # AI crates project

3. Create Rust projects

Bash

cd ~/rust_projects
cargo new polars_test
cargo new rust_ai

4. Install useful crates

In polars_test:

Bash

cd ~/rust_projects/polars_test
cargo add polars --features "lazy,strings,csv,temporal"

In rust_ai:

Bash

cd ~/rust_projects/rust_ai
cargo add linfa candle-core candle-nn ort tokenizers ndarray anyhow serde serde_json

Note: Avoid installing both burn and tch at the same time — they conflict.

5. Install Interactive Rust (like Python’s interactive mode)

Bash

cargo install evcxr_repl

6. Create useful aliases

Add these lines to ~/.bashrc:

Bash

# Interactive Rust (like typing `python`)
alias rust='evcxr'

# Quickly go to AI project
alias rustai='cd ~/rust_projects/rust_ai'

# Create new Rust projects easily
alias newrust='cargo new'

Then reload:

Bash

source ~/.bashrc

7. Daily workflow

For Python:

Bash

cd ~/python_practice
python

For interactive Rust:

Bash

rust

For a Rust project:

Bash

rustai                    # or cd into any project
nano src/main.rs          # edit code
cargo run                 # run it

Create a new Rust project:

Bash

newrust my_new_project
cd my_new_project

Quick Reference Commands

ActionCommand
Start interactive Pythonpython
Start interactive Rustrust
Go to AI projectrustai
Create new Rust projectnewrust project_name
Edit codenano src/main.rs
Run Rust programcargo run
Add a cratecargo add crate_name

This setup gives me a clean separation between Python and Rust while making it very easy to switch between them for daily practice.