Installing Python

By the end of this lesson, Python will be running on your own computer - Windows, Mac, or Linux - and you'll have a clean workspace ready for real bioinformatics work.

🟒 Beginner ⏱️ ~30 min 🐍 Python πŸ’» Windows Β· macOS Β· Linux

βœ‹ You don't need this page yet

Every lesson on BioNexus runs free in your browser with nothing to install (we use Google Colab). This page is optional, and for later: when you're ready to work like a professional on your own computer. New here? Skip it and keep learning in the browser.

When you do graduate to your own machine, the standard professional tools are VS Code (for Python) and RStudio (for R), the same editors used in real bioinformatics jobs. See the VS Code guide and the Help & FAQ.

What we're installing, and why

We'll install Python using the official installer from python.org - the simplest, most universal way to get Python onto your machine. It comes with pip (for installing packages) and venv (for creating isolated "environments" so one project never breaks another). That's everything you need to start, and most beginner tutorials assume exactly this standard setup.

Decode the jargon: environment

An "environment" is a self-contained box holding a specific Python version and set of packages. Project A can use one box, Project B another, and they never collide. It's the single best habit for avoiding the dreaded "it worked yesterday" problem.

Step 1 - Download & install Python

Go to python.org/downloads and download the latest Python (version 3.12 or newer) for your operating system. Then follow the section for your OS below.

πŸͺŸ Windows Windows 10/11

  1. Download the Windows installer (64-bit) .exe from python.org.
  2. Important: on the very first installer screen, tick "Add python.exe to PATH" at the bottom - this lets you run Python from any terminal. Then click Install Now.
  3. When it finishes, open a new Command Prompt or PowerShell from the Start menu. This is your Python-aware terminal.

🍎 macOS Intel & Apple Silicon

  1. Download the macOS 64-bit universal2 installer (.pkg) - one file works on both Apple Silicon and Intel.
  2. Double-click it and follow the wizard, accepting the defaults.

macOS ships with an old system Python, so on a Mac you'll usually type python3 and pip3 (the python.org installer sets these up for you).

🐧 Linux Ubuntu / Debian / Fedora …

  1. Python 3 is usually already installed - check with python3 --version.
  2. If it's missing, or you need pip and venv, install them with your package manager:
# Ubuntu / Debian
sudo apt update && sudo apt install python3 python3-pip python3-venv

# Fedora
sudo dnf install python3 python3-pip

Step 2 - Check it worked

In your terminal (Command Prompt or PowerShell on Windows, Terminal on Mac/Linux), type:

python --version
pip --version

You should see a version number for each (for example Python 3.13.x). If you do - Python is installed. πŸŽ‰ On macOS and Linux, use python3 and pip3 if plain python isn't found.

Step 3 - Make your first environment

Let's create an isolated workspace (a "virtual environment") for your BioNexus learning, then install the core packages into it:

# 1. Create a virtual environment called "bionexus"
python -m venv bionexus          # use python3 on macOS/Linux

# 2. Activate it (do this every time you work)
bionexus\Scripts\activate        # Windows
source bionexus/bin/activate     # macOS / Linux

# 3. With it active, install the packages you'll use
pip install jupyter pandas numpy matplotlib biopython

When the environment is active, you'll see (bionexus) at the start of your prompt - that's how you know which box you're working in. Type deactivate to leave it.

What about conda / Miniconda?

Conda (installed via Miniconda) is a popular alternative in bioinformatics because it can install non-Python command-line tools - like samtools or bwa - right alongside your Python packages. You don't need it to begin: pip and venv cover everything in this Python series. We'll bring in conda later, once you reach tools that require it.

Where you'll write your code

Python is installed - but where do you actually type your code? There's no single right answer; here are the common options, all perfectly valid. Many people use more than one depending on the task.

  • Google Colab - notebooks in your browser, nothing to install. Great for learning and for the lessons on this site.
  • Jupyter - local notebooks. We installed it above with pip; with your environment active, run jupyter notebook to start. Ideal for step-by-step, exploratory analysis.
  • VS Code - a free desktop editor that holds your scripts, files, and a terminal in one window. If you'd like to try it, follow the Set up VS Code guide.
  • PyCharm - a full Python IDE (desktop app) with smart autocomplete, a visual debugger, and built-in Jupyter support; a favorite once your scripts grow. Download steps are just below.
  • RStudio - primarily for R, but worth knowing it exists once you reach the R series.

Pick whichever feels comfortable. You can always switch later - your code runs the same way regardless of where you write it.

Downloading PyCharm

  1. Go to jetbrains.com/pycharm/download and choose your operating system (Windows, macOS, or Linux).
  2. Run the installer and accept the defaults. On Windows you can tick "Add bin folder to PATH" and a desktop shortcut if you'd like.
  3. Open PyCharm, choose New Project, and point it at the bionexus virtual environment you made in Step 3 (Settings β†’ Project β†’ Python Interpreter β†’ Add Interpreter β†’ Existing) - or let PyCharm create a fresh environment for you.

Is PyCharm free?

Yes for learning. PyCharm starts with a free one-month Pro trial, then keeps working for free with its core features - including Jupyter support - which covers everything in these lessons. The paid Pro tier adds database tools, web frameworks, and remote development you won't need yet.

βœ… You're ready when…

python --version prints a version number, and your prompt shows (bionexus) after you activate the environment. That's everything you need for the next lesson.

Stuck? Common snags

"python is not recognized" on Windows

You most likely didn't tick "Add python.exe to PATH" during install. Re-run the installer, choose Modify, enable that option (or reinstall and tick the box), then open a new terminal. As a quick workaround you can also use the py launcher: py --version.

"python --version" shows Python 2.x (macOS / Linux)

Older systems map python to version 2. Use python3 and pip3 instead - e.g. python3 -m venv bionexus.

"Activate.ps1 cannot be loaded" in PowerShell

PowerShell blocks scripts by default. Run this once: Set-ExecutionPolicy -Scope CurrentUser RemoteSigned, then activate again - or just use Command Prompt, where bionexus\Scripts\activate.bat works without any changes.

"pip is not recognized" / not found

Use python -m pip install ... (or python3 -m pip on Mac/Linux). Routing through python -m always finds the right pip, even when the bare pip command isn't on your PATH.

Check your understanding

Which tool installs Python packages?
During the Windows install, why does the lesson tell you to tick "Add python.exe to PATH"?
Adding Python to PATH lets the python and pip commands work from any Command Prompt or PowerShell window, which is why the lesson flags it as important.
What is a virtual environment (like the bionexus one you create)?
A virtual environment is a self-contained box of a Python version and packages, so one project's installs never break another's.
After activating your environment, how can you tell it is active?
When a virtual environment is active, its name appears in parentheses at the start of your prompt, such as (bionexus), and you type deactivate to leave it.
On macOS and Linux, what should you type if plain python and pip are not found?
Older Macs and Linux systems may map python to an old version, so the lesson tells you to use python3 and pip3 instead, for example python3 -m venv bionexus.
Next in the Python series

Python basics with real biological data β†’