Skip to content

Instantly share code, notes, and snippets.

@faysou
Last active June 25, 2025 00:08
Show Gist options
  • Save faysou/c7adc018e99ac05c9a63ac092a06e7f5 to your computer and use it in GitHub Desktop.
Save faysou/c7adc018e99ac05c9a63ac092a06e7f5 to your computer and use it in GitHub Desktop.
Install nautilus_trader dev env from scratch using uv only
curl https://sh.rustup.rs -sSf | bash -s -- -y
source ~/.cargo/env

curl -LsSf https://astral.sh/uv/install.sh | sh
source ~/.zshrc

NAUTILUS_DIR=~/Developer/nautilus
mkdir -p $NAUTILUS_DIR
cd $NAUTILUS_DIR
git clone --single-branch --branch develop https://github.com/nautechsystems/nautilus_trader.git
cd $NAUTILUS_DIR/nautilus_trader

uv python install 3.13
uv venv
echo -e "\nsource $NAUTILUS_DIR/nautilus_trader/.venv/bin/activate" >> ~/.zshrc
source ~/.zshrc

make install-debug

brew install pre-commit
pre-commit install

uv pip install jupyter chardet jupyterlab_execute_time databento polars ipyfilechooser \
lightweight_charts jupytext xmltodict maturin jupyterlab-quarto qgridnext \
anywidget great_tables scipy
uv run jupytext-config set-default-viewer

cargo install --locked evcxr_jupyter  
evcxr_jupyter --install

PYTHON_PATH=$(which python)
echo -e "\n[env]\nPYO3_PYTHON = \"$PYTHON_PATH\"" >> .cargo/config.toml
git update-index --skip-worktree .cargo/config.toml
@ikeepo
Copy link

ikeepo commented Feb 14, 2025

miss one command for the person who didn't install python version 3.12.7:
pyenv install 3.12.7

@faysou
Copy link
Author

faysou commented Feb 14, 2025

Ok thanks

@stefansimik
Copy link

stefansimik commented Mar 2, 2025

miss one command for the person who didn't install python version 3.12.7: pyenv install 3.12.7

Ooh, no, don't use pyenv πŸ™
That would contradict the whole purpose of why we use uv in the first place. 😊
uv was designed to replace old pyenv and it has its own quick & much more efficient rust-based commands to install python

Example:
uv python install 3.12

More detail here: https://htmlpreview.github.io/?https://github.com/stefansimik/dev_guides/blob/main/uv/uv_quick_reference.html#managing-python

@faysou
Copy link
Author

faysou commented Mar 2, 2025

The comment on pyenv was regarding the previous version of this text that was using pyenv (still visible in the revisions history), uv in nautilus is very new (today).

Also I don't think uv python install is necessary, uv sync in make install does this already.

@stefansimik
Copy link

Clear now πŸ‘
(I really missed, this was too old comment πŸ™ )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment