Skip to content

Commit cd6cdf9

Browse files
committed
feat: enhance Python section with virtual environment setup and package management guidance
1 parent ddfb478 commit cd6cdf9

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/posts/python.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,15 @@ If you want to use community-made Python scripts, you'll often find them on GitH
4444
Python is great, but installing packages directly into the system's Python is usually a bad idea. On the Steam Deck, it might even fail because the core system is "read-only."
4545

4646
### 1. The Standard Way: `venv`
47-
The "proper" way to install Python packages is by creating a **Virtual Environment**. This creates a tiny, private sandbox for your project so its packages don't mess with the rest of your system.
47+
Imagine you're running two community scripts: one needs version 1 of a library, the other needs version 2. They can't both be installed at the same time — they'd conflict. A **Virtual Environment** solves this by giving each project its own private sandbox, completely isolated from everything else. The system Python stays untouched, your scripts stay happy.
4848
```bash
49-
python -m venv my-project
50-
source my-project/bin/activate
49+
# Make sure you're in the folder of your Python project
50+
cd ~/MyPythonProject
51+
# Create a new virtual environment in the current folder
52+
python -m venv .venv
53+
source .venv/bin/activate
5154
```
55+
Once activated, any packages you install with `pip` go into that sandbox, not the system. When you're done, just type `deactivate`.
5256

5357
### 2. The Modern Choice: uv ⚡
5458
If you want the fastest and easiest experience, check out **[uv](https://github.com/astral-sh/uv)**. It's a "blazingly fast" Python package manager that manages your environments and packages automatically. You can install it with just one command:

0 commit comments

Comments
 (0)