Python for Non-Programmers: When Claude Asks You to Install Something
Who this is for: Researchers using Claude Code who have never written Python and don't want to — but keep running into moments where Claude says "please install this package" or "run this script" and you don't know what to do next.
You do not need to learn Python. You need to understand just enough to not get stuck.
Why Python keeps coming up
Claude Code itself runs on Node.js — that's what you installed when you set up Claude Code. But many of the tasks Claude does for you use Python: converting PDFs, processing spreadsheets, analysing data, running scripts it writes. Python is the Swiss Army knife of research automation, and Claude reaches for it constantly.
The good news: you don't need to understand Python to use it. You need to know:
1. Whether Python is installed on your computer
2. What pip install means and how to do it
3. What to do when something goes wrong
4. How to ask Claude to handle all of this for you
Step 1: Do you have Python?
Open a terminal and type:
python --version
Or, if that doesn't work:
python3 --version
If you see Python 3.10.x or similar — you have Python. Done. Skip to the next section.
If you see "command not found" or "not recognized" — Python is not installed. Download and install it from python.org — choose the latest stable version, and on Windows, check the box that says "Add Python to PATH" during installation. This is the single most important checkbox in the installer; without it, nothing will work.
After installing, close and reopen your terminal, then run python --version again to confirm.
Step 2: What does "pip install" mean?
When Claude says something like:
Please run
pip install pandas openpyxlto continue.
Here is what that means:
-
pip is Python's package manager — a tool for downloading and installing Python add-ons
-
pandas and openpyxl are packages — bundles of code that do specific things (pandas handles spreadsheets and data tables; openpyxl reads Excel files)
-
Claude cannot install packages itself — it can only run commands you permit; installing new software requires your explicit action
To run the command, copy it exactly, paste it into your terminal, and press Enter. You will see text scroll by as packages download. Wait for the prompt to return. Then tell Claude "done" and it will continue.
That's it. Most pip install commands are one-line, take under a minute, and work on the first try.
Step 3: The uv alternative (faster, safer)
If Claude suggests uv instead of pip — follow it. uv is a modern, faster package manager that Claude Code often prefers. Commands look like:
uv pip install pandas
or
uv add pandas
uv is better than pip for project work because it installs packages into your project folder rather than your whole computer (more on why this matters below). If you don't have uv, Claude will tell you how to install it, or you can install it with:
pip install uv
Step 4: Virtual environments — what they are and when to care
You may occasionally see Claude create or mention a virtual environment (also called .venv or venv). This is a self-contained Python installation inside your project folder, so that packages installed for this project don't interfere with other Python software on your computer.
You don't need to understand virtual environments deeply. You need to know two things:
If Claude creates one, it will also tell you to "activate" it before installing packages. The activation command looks like:
# Windows (PowerShell)
.venv\Scripts\activate
# Mac / Linux
source .venv/bin/activate
After activation, your terminal prompt usually changes to show (.venv) at the start. This means packages you install now go into the project folder, not globally. Claude will tell you when you need to do this.
If you forget to activate and install packages globally instead, nothing breaks — the packages still work. The only downside is they accumulate on your system over time. For occasional research use, this is not a serious problem.
Common failure moments and what to do
pip: command not found
Python is installed but pip is not on your PATH, or Python is not on your PATH. Try python -m pip install [package] instead. If that also fails, tell Claude the exact error message — it will diagnose it.
Permission denied
On Mac/Linux: add --user to the end of the command: pip install pandas --user. This installs to your user folder instead of a system folder that requires administrator access.
ModuleNotFoundError: No module named 'X'
The package is not installed, or it is installed in a different Python environment than the one Claude is using. Tell Claude the error; it will either give you the install command or switch to a compatible approach.
pip install succeeds but the script still fails
You may have multiple Python installations and the package installed into a different one. Tell Claude: "I ran pip install X but still get the module not found error. I have Python [version]." Claude will sort out the environment mismatch.
The terminal closes or the error scrolls past too fast Copy the last few lines of the error and paste them to Claude. You don't need to understand them — Claude does.
The better approach: ask Claude to handle it
For most research tasks, you don't need to manage Python setup manually. At the start of a session, you can say:
Before we start — if you need any Python packages, install them yourself using uv. Check first whether they're already installed. Tell me if anything fails.
Claude will check, install, and report. You never see a pip install command.
For longer projects, add a line to your CLAUDE.md:
Python setup: Use uv for all package management. Install into the project virtual environment. Check for existing packages before installing new ones.
This makes Python setup automatic across all sessions in that project.
What you don't need to worry about
Reading Python code. Claude will write and run scripts for you. You need to understand what a script does (Claude will explain it), not how it's written.
Learning pip in depth. The three commands in this document — pip install X, python -m pip install X, and pip install X --user — cover 95% of situations you will encounter.
Version conflicts. Claude Code's use of Python for research automation tasks is almost never sensitive to exact version differences. If you have Python 3.9 or later, you are fine.
Security. The packages Claude asks you to install are standard scientific Python libraries (pandas, openpyxl, markitdown, requests, etc.) — the same ones used by millions of researchers. If Claude asks you to install something unfamiliar, ask what it does before running the command.
Related
-
A3.code-basics-non-programmers — Claude Code basics: installation, terminal, first launch
-
A.markdown-central — markitdown for PDF/DOCX conversion; the
pip install "markitdown[pdf]"pattern -
D.tutorial.setup — full setup guide including Python and Node.js for Windows
-
A.issue.plan-mode — how to review what Claude plans to do before it runs scripts
-
A.concept.agents — how Claude runs tools and scripts on your behalf; supervision principles