Python is the best programming language for an 8 GB laptop, provided you do not install half the ecosystem before writing a line of code. The default advice online — install Anaconda, then a dozen extensions — is how people end up with 3 GB of RAM consumed before their script starts.
This is the lean setup I use on the test machine. It takes about twenty minutes.
The result
Python 3.12 + venv + VS Code with four extensions. Idle memory after opening the editor: about 600 MB. A basic script starts in under a second. No Anaconda, no Jupyter required.
1. Install Python (not a distribution)
Download the official installer from python.org and run it.
Two things to tick on the first screen:
- Add python.exe to PATH — saves a lot of terminal pain.
- Install launcher for all users — optional, but convenient.
Then choose “Customize installation” and leave the optional features on, but skip “Install for all users” unless you need it. The default install is around 100 MB.
Verify in a new terminal:
python --version
py --version
Either command should report 3.12.x or 3.13.x. If python opens the Microsoft Store, the PATH entry did not take; reinstall and tick the box.
Why not Anaconda?
A full Anaconda install is roughly 3–5 GB and includes hundreds of packages you will never import. It also adds a base environment that encourages installing everything globally. On 8 GB, that is memory and disk you cannot spare. Miniforge is a lighter alternative if you genuinely need conda.
2. Create a project folder and a virtual environment
Pick a short path without spaces, for example C:\dev\hello-python:
mkdir C:\dev\hello-python
cd C:\dev\hello-python
python -m venv .venv
.venv\Scripts\activate
Your prompt should now start with (.venv). That means packages install into this project, not globally.
python -m pip install --upgrade pip
That is the entire environment setup. No requirements.txt yet — add one when you have dependencies worth pinning.
3. Install VS Code without the bloat
Install VS Code, then add exactly four extensions:
| Extension | Why |
|---|---|
| Python (Microsoft) | Interpreter selection, linting, debugging |
| Pylance | Fast type checking and completions |
| Ruff | Linting and formatting in one tool |
| Error Lens | Shows errors inline instead of in a panel |
Skip themes, icon packs, Git GUI extensions and AI assistants for now. The VS Code memory guide explains why, with measurements.
Open the folder:
code .
VS Code should detect .venv and offer it as the interpreter. If not, press Ctrl+Shift+P → “Python: Select Interpreter” → choose the one inside .venv.
4. Write and run the first script
Create hello.py:
from datetime import date
def days_until(target: date) -> int:
return (target - date.today()).days
if __name__ == "__main__":
print(f"Days until 2030: {days_until(date(2030, 1, 1))}")
Run it with the play button, or:
python hello.py
If that works, the environment is correct. Everything else is libraries.
5. Add dependencies the sane way
python -m pip install requests
python -m pip freeze > requirements.txt
When you clone a project later:
python -m venv .venv
.venv\Scripts\activate
python -m pip install -r requirements.txt
Two habits that prevent most environment disasters:
- Never install project packages globally. If
pip installworks without an active venv, stop and check. - Commit
requirements.txt, not.venv. Add.venv/to.gitignore.
6. Keep memory use low
Python itself is small. The libraries are not.
| Tool | Approx. idle RAM | Note |
|---|---|---|
| Python + stdlib | 25–40 MB | Fine |
| requests / httpx | +20 MB | Fine |
| pandas | +150–250 MB | Heavy for small CSVs |
| JupyterLab (browser) | +400–700 MB | The browser is the cost |
| PyTorch (CPU) | +300–500 MB | Import alone is heavy |
| VS Code + Pylance | +400–600 MB | Acceptable |
Practical rules:
- Use
csvorpolarsfor small files. pandas is convenient but overkill for a 5,000-row CSV. - Avoid Jupyter for scripts. Use it for exploration, then move the logic into a
.pyfile. - Close the browser while running a heavy job. It is often the largest consumer.
- Check imports with
python -X importtime your_script.pyif startup feels slow.
If a script needs more than your free RAM, it is a cloud job. See free cloud GPU limits.
7. Git, briefly
git init
git add hello.py requirements.txt .gitignore
git commit -m "first script"
Create a .gitignore:
.venv/
__pycache__/
*.pyc
.env
Do not commit secrets. Use a .env file and python-dotenv if you need configuration.
The setup in one screen
C:\dev\hello-python\
├── .venv\ (not committed)
├── .gitignore
├── hello.py
└── requirements.txt
That is enough to build scripts, automate files, call APIs and follow most Python tutorials. No 5 GB distribution, no 20 extensions, no memory pressure before the first import.
FAQ
Can I use the Microsoft Store version of Python?
It works, but it installs into a sandboxed path and can confuse tools that expect a normal installation. The python.org installer is more predictable.
Do I need PyCharm?
No. PyCharm is a good IDE, but its memory footprint is higher than VS Code's on this class of machine. VS Code with Pylance is the better fit at 8 GB.
How do I run a script with a specific Python version?
Use the launcher: py -3.12 hello.py. On Linux/macOS, call the interpreter inside the venv directly.
What if pip install fails with a compiler error?
Some packages need build tools on Windows. Prefer packages with wheels, or install “Microsoft C++ Build Tools” only if you truly need to compile. Often there is a pure-Python alternative.
Related reports
- VS Code on a memory diet
- Fix the freezes on an 8 GB laptop
- Run a local coding assistant
- Gear and upgrades