Where this fits
You can do everything on this site without a local editor - Google Colab runs in your browser, and RStudio comes with R. But many people prefer a proper desktop editor for writing scripts, organizing project files, and running a terminal all in one place. VS Code is one popular, free choice. This page is entirely optional - pick the workspace that suits you.
Honest framing: it's one option among several
There's no single "correct" editor. Plenty of bioinformaticians happily use Colab, Jupyter, RStudio, or VS Code - or several depending on the task. We're showing VS Code because it's free, cross-platform, and works well for Python and the command line. If you're happy in Colab or RStudio, you can skip this and lose nothing.
Pick your workspace (a neutral comparison)
| Colab | Browser-based, zero install, great for learning and sharing. Needs internet; best for notebooks. |
| Jupyter | Local notebooks (install with pip install jupyter). Excellent for step-by-step, exploratory analysis. |
| RStudio | The natural home for R. Tailored to R projects, plots, and packages. |
| VS Code | A general editor for scripts and projects in many languages, with a built-in terminal. This page sets it up. |
Step 1 - Download & install VS Code
Get it from the official site: code.visualstudio.com. Then follow your OS below.
πͺ Windows Windows 10/11
- Download the Windows installer (
.exe) from code.visualstudio.com. - Run it. On the "Select Additional Tasks" screen, tick "Add to PATH" and "Open with Code" options - they make life easier later.
- Launch VS Code from the Start menu.
π macOS Intel & Apple Silicon
- Download the Mac build (it's universal - works on both Intel and Apple Silicon).
- Unzip it and drag Visual Studio Code into your Applications folder.
- Open it from Applications (right-click β Open the first time if macOS warns about an internet-downloaded app).
π§ Linux Ubuntu / Debian / Fedora
- On Ubuntu/Debian, download the
.deband install it (double-click, orsudo apt install ./code_*.deb). - On Fedora, download the
.rpmand install withsudo dnf install ./code-*.rpm. - Launch from your applications menu or by typing
codein a terminal.
Step 2 - Open a folder for your work
VS Code works best when you open a folder (a project), not just a single file. Make a folder for your BioNexus work, then in VS Code: File β Open Folderβ¦ and select it. The left sidebar (the Explorer) now shows your files.
Step 3 - Open the built-in terminal
One of VS Code's best features: a terminal lives right inside it. Open it with Terminal β New Terminal (or Ctrl+`, the backtick key). This is the same command line from the Bash lessons - now docked next to your code.
Why one window matters
Editor, files, and terminal in a single place means you can write a script, run it, and read the output without switching apps. That tight loop is exactly why many people like VS Code for everyday work.
Step 4 - Add the Python extension
VS Code becomes Python-aware once you add one free extension:
- Click the Extensions icon in the left bar (the four-squares icon), or press
Ctrl/Cmd+Shift+X. - Search "Python" and install the one published by Microsoft.
- It pulls in helpful tools automatically (including support for Jupyter notebooks).
If you created the bionexus virtual environment earlier, VS Code will detect it. Pick it via the environment selector at the bottom of the window or the command palette (Ctrl/Cmd+Shift+P β "Python: Select Interpreter").
Working in R instead?
There's also an R extension for VS Code if you'd like to use it for R - though for R specifically, many people find RStudio more comfortable out of the box. Use whichever you prefer.
Step 5 - Run your first file
- In your folder, create a file called
hello.py(File β New File, or the + in the Explorer). - Type:
dna = "ATGCGT" print("GC count:", dna.count("G") + dna.count("C"))
- Click the βΆ Run button (top-right), or right-click β "Run Python File in Terminal". The output appears in the terminal below.
Bonus - notebooks inside VS Code
Prefer the notebook style from the lessons? With the Python extension installed, VS Code opens .ipynb notebook files directly - same cells-and-output experience as Colab and Jupyter, just on your desktop. Create a file ending in .ipynb and start adding cells.
β You're set up whenβ¦
VS Code opens your project folder, the integrated terminal works, the Microsoft Python extension is installed, and running hello.py prints output in the terminal.
Stuck? Common snags
"Run" doesn't use my bionexus environment
Press Ctrl/Cmd+Shift+P, type "Python: Select Interpreter", and choose your bionexus environment. VS Code remembers it per folder.
Typing code in the terminal does nothing (Mac)
Open VS Code, press Cmd+Shift+P, run "Shell Command: Install 'code' command in PATH", then reopen your terminal.
It looks overwhelming with lots of panels
That's normal at first. You really only need three things: the Explorer (files, left), the editor (middle), and the terminal (bottom). Ignore the rest until you need it.
