astr400
Editor and notebooks

Using Jupyter and a text editor

Most astrophysics work is easiest in a notebook for exploration and a text editor for scripts, modules, and larger projects. A common setup is VS Code with the Python extension plus Jupyter support.

1. Install a text editor

Visual Studio Code is a strong choice for scientific work: code.visualstudio.com.

After installation, open VS Code and install the Python extension and the Jupyter extension.

2. Install Jupyter

Install Jupyter in the environment you already created.

Conda

conda install -c conda-forge jupyterlab

Launch notebooks:

jupyter lab

uv

uv add jupyterlab

Launch notebooks through uv so they use the project environment:

uv run jupyter lab

3. Use the environment in VS Code

Select the right interpreter in VS Code:

For a Jupyter kernel created by uv:

uv run python -m ipykernel install --user --name astro-template

4. Good workflow habits

Coming from uv? The previous step is uv setup.