|
| 1 | +### 🚀 Part 1: Create the Environment (In Your Terminal) |
| 2 | + |
| 3 | +First, install `uv`. Then, run **all** of the following commands in your system terminal (like Terminal, PowerShell, or bash) from the root folder of the `tentris-quickstart` project. |
| 4 | + |
| 5 | +**Do not** run these in a notebook cell. |
| 6 | + |
| 7 | +**1. Install `uv` (if not already done):** |
| 8 | +Run **one** of these commands in your terminal. |
| 9 | + |
| 10 | +* *On macOS / Linux:* |
| 11 | + ```bash |
| 12 | + curl -LsSf [https://astral.sh/uv/install.sh](https://astral.sh/uv/install.sh) | sh |
| 13 | + ``` |
| 14 | +* *On Windows (PowerShell):* |
| 15 | + ```bash |
| 16 | + pip install uv |
| 17 | + ``` |
| 18 | + |
| 19 | +> **Note:** After installing, you may need to **restart your terminal or VS Code** for the `uv` command to be recognized. |
| 20 | + |
| 21 | +**2. Create the Environment and Install Packages:** |
| 22 | +These commands will create a local `.venv` folder, install all project dependencies (including `ipykernel`), and register it as a named kernel for Jupyter/VS Code. |
| 23 | + |
| 24 | +```bash |
| 25 | +# 1. Clean up any old environment (optional, but safe) |
| 26 | +rm -rf .venv |
| 27 | +
|
| 28 | +# 2. Create a new, empty virtual environment |
| 29 | +uv venv |
| 30 | +
|
| 31 | +# 3. Install all project dependencies from the pyproject.toml file |
| 32 | +uv pip install "./src/tentris-quickstart[dev]" |
| 33 | +``` |
| 34 | + |
| 35 | +**3. Register the Kernel:** |
| 36 | +Now, run the command for your operating system to make the new environment visible to Jupyter/VS Code. |
| 37 | + |
| 38 | +* *On macOS / Linux:* |
| 39 | + ```bash |
| 40 | + .venv/bin/python -m ipykernel install --user --name="tentris-env" --display-name="Python (Tentris)" |
| 41 | + ``` |
| 42 | +* *On Windows (PowerShell):* |
| 43 | + ```bash |
| 44 | + .venv\Scripts\python.exe -m ipykernel install --user --name="tentris-env" --display-name="Python (Tentris)" |
| 45 | + ``` |
| 46 | + |
| 47 | +--- |
| 48 | + |
| 49 | +### 💻 Part 2: Run the Notebook (In VS Code) |
| 50 | + |
| 51 | +Now that your environment is built and registered, you can start the notebook. |
| 52 | + |
| 53 | +1. **Open VS Code:** Open the *entire* `tentris-quickstart` folder in VS Code (File > Open Folder...). |
| 54 | +2. **Open this Notebook:** Open the `.ipynb` notebook file. |
| 55 | +3. **Select the Kernel:** |
| 56 | + * Click the "Select Kernel" button in the top-right corner of the notebook. |
| 57 | + * From the dropdown list, choose **"Python (Tentris)"**. This is the name you just registered. |
| 58 | + * If VS Code prompts you, it may also auto-detect the `.venv` folder. Selecting that also works, but the named kernel is more explicit. |
| 59 | + |
| 60 | +You are now ready to run the cells in the notebook. |
0 commit comments