From c6c350770719979c9a78a8b830f8f601b15d3a8a Mon Sep 17 00:00:00 2001 From: Inessa Pawson Date: Thu, 8 Oct 2026 14:55:00 -0400 Subject: [PATCH 1/3] docs: show conda and venv activation steps in "install your package locally" --- tutorials/create-python-package.md | 54 +++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/tutorials/create-python-package.md b/tutorials/create-python-package.md index 630a8a717..0d254acdb 100644 --- a/tutorials/create-python-package.md +++ b/tutorials/create-python-package.md @@ -321,23 +321,48 @@ You are now ready to install (and build) your Python package! While you can do this using Hatch, we will use pip for this lesson, so you can see how to install your tool into your preferred environment. First, open your preferred shell (Windows users may use something like GitBash) and `cd` into your project directory if you are not already there. -- Activate the Python environment that you wish to use. -- Run `python -m pip install -e .` +Next, activate the Python environment that you wish to use. We recommend +installing packages that you are developing into a virtual environment +rather than your system Python. If you don't have one yet: -:::{todo} -Add this back in when the lesson is published -- Activate the Python environment that you wish to use. If you need help with working with virtual environments check out this lesson (add link). -::: +- **conda:** install [Miniforge](https://conda-forge.org/download/) (or + [Miniconda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html)), + then run `conda create -n pyosdev python` +- **venv:** ships with Python; run `python -m venv .venv` in your project + directory. See the [venv docs](https://docs.python.org/3/library/venv.html). + +Then activate it: +::::{tab-set} + +:::{tab-item} conda ```bash -# Activate your environment using conda or venv -# Below we use conda but you can do the same thing with venv! > conda activate pyosdev -(pyosdev) -> conda info - active environment : pyosdev - active env location : /Users/your-path/mambaforge/envs/pyosdev -# Cd into your project directory +(pyosdev) > +``` +::: + +:::{tab-item} venv (macOS / Linux) +```bash +> source .venv/bin/activate +(.venv) > +``` +::: + +:::{tab-item} venv (Windows) +```powershell +> .venv\Scripts\activate +(.venv) > +``` +::: + +:::: + +Your prompt will show the environment name once it is active. Now install +your package: + +```bash +# Cd into your project directory (if you are not already there) > cd pyospackage # Install your package > python -m pip install -e . @@ -348,8 +373,7 @@ Obtaining file:///Users/leahawasser/Documents/GitHub/pyos/pyosPackage Getting requirements to build editable ... done # Check to see if the package is installed -> conda list -# use pip list instead of conda list here if you are working in an venv environment rather than a conda envt +> python -m pip list ``` :::{admonition} What does `python -m pip install -e .` do? From 93af96fc805848e1ce66faa4be0858b17a176894 Mon Sep 17 00:00:00 2001 From: Inessa Pawson Date: Thu, 8 Oct 2026 15:10:44 -0400 Subject: [PATCH 2/3] docs: clarify why create-python-package uses pip instead of Hatch --- tutorials/create-python-package.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tutorials/create-python-package.md b/tutorials/create-python-package.md index 0d254acdb..1bc180374 100644 --- a/tutorials/create-python-package.md +++ b/tutorials/create-python-package.md @@ -318,9 +318,14 @@ At this point, you should have: You are now ready to install (and build) your Python package! -While you can do this using Hatch, we will use pip for this lesson, so you can see how to install your tool into your preferred environment. +While Hatch can create an environment and install your package for you +(you'll learn how in the [Hatch environments lesson](develop-python-package-hatch)), +this lesson uses `pip` directly so you can see what is happening when a +package is installed into a Python environment. + +First, open your preferred shell (Windows users may use something like GitBash) +and `cd` into your project directory if you are not already there. -First, open your preferred shell (Windows users may use something like GitBash) and `cd` into your project directory if you are not already there. Next, activate the Python environment that you wish to use. We recommend installing packages that you are developing into a virtual environment rather than your system Python. If you don't have one yet: From 78a66a4a8d33fbb3ec45505c47cdd09473173429 Mon Sep 17 00:00:00 2001 From: Leah Wasser Date: Wed, 21 Oct 2026 14:31:46 -0600 Subject: [PATCH 3/3] Apply batched suggestions from code review Co-authored-by: Leah Wasser --- tutorials/create-python-package.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tutorials/create-python-package.md b/tutorials/create-python-package.md index 1bc180374..503f73fd6 100644 --- a/tutorials/create-python-package.md +++ b/tutorials/create-python-package.md @@ -320,8 +320,8 @@ You are now ready to install (and build) your Python package! While Hatch can create an environment and install your package for you (you'll learn how in the [Hatch environments lesson](develop-python-package-hatch)), -this lesson uses `pip` directly so you can see what is happening when a -package is installed into a Python environment. +this lesson uses `pip` to install your package, so you can see what is happening when a +package is installed into a Python environment that you create. First, open your preferred shell (Windows users may use something like GitBash) and `cd` into your project directory if you are not already there.