@@ -318,26 +318,56 @@ At this point, you should have:
318318
319319You are now ready to install (and build) your Python package!
320320
321- 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.
321+ While Hatch can create an environment and install your package for you
322+ (you'll learn how in the [ Hatch environments lesson] ( develop-python-package-hatch ) ),
323+ this lesson uses ` pip ` to install your package, so you can see what is happening when a
324+ package is installed into a Python environment that you create.
322325
323- First, open your preferred shell (Windows users may use something like GitBash) and ` cd ` into your project directory if you are not already there.
324- - Activate the Python environment that you wish to use.
325- - Run ` python -m pip install -e . `
326+ First, open your preferred shell (Windows users may use something like GitBash)
327+ and ` cd ` into your project directory if you are not already there.
326328
327- :::{todo}
328- Add this back in when the lesson is published
329- - Activate the Python environment that you wish to use. If you need help with working with virtual environments check out this lesson (add link).
330- :::
329+ Next, activate the Python environment that you wish to use. We recommend
330+ installing packages that you are developing into a virtual environment
331+ rather than your system Python. If you don't have one yet:
332+
333+ - ** conda:** install [ Miniforge] ( https://conda-forge.org/download/ ) (or
334+ [ Miniconda] ( https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html ) ),
335+ then run ` conda create -n pyosdev python `
336+ - ** venv:** ships with Python; run ` python -m venv .venv ` in your project
337+ directory. See the [ venv docs] ( https://docs.python.org/3/library/venv.html ) .
338+
339+ Then activate it:
340+
341+ ::::{tab-set}
331342
343+ :::{tab-item} conda
332344``` bash
333- # Activate your environment using conda or venv
334- # Below we use conda but you can do the same thing with venv!
335345> conda activate pyosdev
336- (pyosdev)
337- > conda info
338- active environment : pyosdev
339- active env location : /Users/your-path/mambaforge/envs/pyosdev
340- # Cd into your project directory
346+ (pyosdev) >
347+ ```
348+ :::
349+
350+ :::{tab-item} venv (macOS / Linux)
351+ ``` bash
352+ > source .venv/bin/activate
353+ (.venv) >
354+ ```
355+ :::
356+
357+ :::{tab-item} venv (Windows)
358+ ``` powershell
359+ > .venv\Scripts\activate
360+ (.venv) >
361+ ```
362+ :::
363+
364+ ::::
365+
366+ Your prompt will show the environment name once it is active. Now install
367+ your package:
368+
369+ ``` bash
370+ # Cd into your project directory (if you are not already there)
341371> cd pyospackage
342372# Install your package
343373> python -m pip install -e .
@@ -348,8 +378,7 @@ Obtaining file:///Users/leahawasser/Documents/GitHub/pyos/pyosPackage
348378 Getting requirements to build editable ... done
349379
350380# Check to see if the package is installed
351- > conda list
352- # use pip list instead of conda list here if you are working in an venv environment rather than a conda envt
381+ > python -m pip list
353382` ` `
354383
355384:::{admonition} What does ` python -m pip install -e .` do?
0 commit comments