Skip to content

[Python Course] Rework Virtual Environment#156

Open
manuf3006 wants to merge 1 commit intomainfrom
PythonExtensive]-rework-venv
Open

[Python Course] Rework Virtual Environment#156
manuf3006 wants to merge 1 commit intomainfrom
PythonExtensive]-rework-venv

Conversation

@manuf3006
Copy link
Member

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request reworks the virtual environment section in the Python course documentation, making it more accessible and structured for learners. The changes add a practical analogy (cooking/kitchen metaphor), reorganize content with a clear three-step process, and include visual aids to help students understand and work with virtual environments.

Changes:

  • Added a kitchen/cooking analogy to explain the concept of virtual environments
  • Restructured the virtual environment workflow into three clear steps: create, activate, and select
  • Added new images showing terminal activation and kernel selection in VS Code
  • Enhanced warnings about virtual environment folder structure and usage
  • Improved explanations about when activation is needed vs. kernel selection

Reviewed changes

Copilot reviewed 1 out of 3 changed files in this pull request and generated 9 comments.

File Description
docs/python/packages.md Reworked virtual environment section with new analogy, clearer step-by-step instructions, and additional warnings/information boxes
docs/assets/python-extensive/venv_terminal.png Added screenshot showing activated virtual environment in terminal

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


<div style="display: flex; justify-content: center; align-items: center; flex-direction: column; margin-bottom: 1rem;">
<div class="tenor-gif-embed" data-postid="23277809" data-share-method="host" data-aspect-ratio="1.33891" data-width="50%">
<a href="https://tenor.com/view/allergies-allergic-reaction-the-big-bang-theory-howard-wolowitz-peanut-reaction-gif-23277809">Allergies Allergic Reaction GIF</a>from <a href="https://tenor.com/search/allergies-gifs">Allergies GIFs</a>
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a spacing issue on line 216. There should be a space between "GIF" and "from" in the link text. It should read "Allergies Allergic Reaction GIF from" instead of "GIFfrom".

Suggested change
<a href="https://tenor.com/view/allergies-allergic-reaction-the-big-bang-theory-howard-wolowitz-peanut-reaction-gif-23277809">Allergies Allergic Reaction GIF</a>from <a href="https://tenor.com/search/allergies-gifs">Allergies GIFs</a>
<a href="https://tenor.com/view/allergies-allergic-reaction-the-big-bang-theory-howard-wolowitz-peanut-reaction-gif-23277809">Allergies Allergic Reaction GIF</a> from <a href="https://tenor.com/search/allergies-gifs">Allergies GIFs</a>

Copilot uses AI. Check for mistakes.
#### Deactivate a environment
Once the environment is activated, you can see the name of the environment (here `.venv`) in the terminal.

![Venv in the Terminal](../assets/python-extensive/venv_terminal.png){ align=center }
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two trailing spaces after "align=center" in the image markdown. While this doesn't break functionality, it's inconsistent and should be removed for cleaner code.

Suggested change
![Venv in the Terminal](../assets/python-extensive/venv_terminal.png){ align=center }
![Venv in the Terminal](../assets/python-extensive/venv_terminal.png){ align=center }

Copilot uses AI. Check for mistakes.
└── my_script.ipynb
```

#### Activate a environment
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a grammatical error in the section heading. It should be "Activate an environment" instead of "Activate a environment". The article "an" should be used before words starting with a vowel sound.

Suggested change
#### Activate a environment
#### Activate an environment

Copilot uses AI. Check for mistakes.

Previously, we have installed the package `seaborn`. The package itself was
available system-wide as we did not create a virtual environment beforehand.
available system-wide as we did not create a virtual environment beforehand.
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a trailing whitespace at the end of line 203 after "beforehand." This should be removed for cleaner code.

Suggested change
available system-wide as we did not create a virtual environment beforehand.
available system-wide as we did not create a virtual environment beforehand.

Copilot uses AI. Check for mistakes.

![Venv in the Terminal](../assets/python-extensive/venv_terminal.png){ align=center }

From now on, every package you install will be installed in the virtual environment and only available if you select the virtual environment for you Jupyter or Python file (see next section). You can check if a package is installed by typing `pip list` in the terminal. Note, that once you close the terminal or VSCode, the environment will be deactivated. You only need to activate the environment if you want to install or remove a package from your virtual environment. You can use it in your file even if the environment is not activated.
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The explanation states "You only need to activate the environment if you want to install or remove a package from your virtual environment. You can use it in your file even if the environment is not activated." This is technically accurate for VS Code when you've selected the virtual environment as your kernel, but it might be confusing for beginners. It would be clearer to emphasize that: (1) activation is needed for terminal operations like pip install, and (2) selecting the kernel in VS Code/Jupyter is separate from terminal activation. Consider rephrasing to make this distinction more explicit.

Suggested change
From now on, every package you install will be installed in the virtual environment and only available if you select the virtual environment for you Jupyter or Python file (see next section). You can check if a package is installed by typing `pip list` in the terminal. Note, that once you close the terminal or VSCode, the environment will be deactivated. You only need to activate the environment if you want to install or remove a package from your virtual environment. You can use it in your file even if the environment is not activated.
From now on, every package you install from this activated terminal (for example with `pip install` or `python -m pip install`) will be installed into the virtual environment. In VS Code or Jupyter you also need to select this virtual environment as the Python/Jupyter kernel for your notebook or script (see next section); this kernel selection is separate from activating the environment in the terminal. Use activation whenever you run terminal commands that should use the virtual environment (such as `pip install`, `pip list`, or running a script). Note that once you close the terminal or VS Code, the environment in that terminal will be deactivated, but files that use the virtual-environment kernel will still run with the packages from that environment.

Copilot uses AI. Check for mistakes.

1. Create a virtual environment
2. Activate the virtual environment
3. Select the virtual environment as you Jupyter or Python kernel
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo in "you" instead of "your". The text should read "Select the virtual environment as your Jupyter or Python kernel" instead of "as you Jupyter or Python kernel".

Suggested change
3. Select the virtual environment as you Jupyter or Python kernel
3. Select the virtual environment as your Jupyter or Python kernel

Copilot uses AI. Check for mistakes.

![Venv in the Terminal](../assets/python-extensive/venv_terminal.png){ align=center }

From now on, every package you install will be installed in the virtual environment and only available if you select the virtual environment for you Jupyter or Python file (see next section). You can check if a package is installed by typing `pip list` in the terminal. Note, that once you close the terminal or VSCode, the environment will be deactivated. You only need to activate the environment if you want to install or remove a package from your virtual environment. You can use it in your file even if the environment is not activated.
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo in "you" instead of "your". The text should read "only available if you select the virtual environment for your Jupyter or Python file" instead of "for you Jupyter or Python file".

Suggested change
From now on, every package you install will be installed in the virtual environment and only available if you select the virtual environment for you Jupyter or Python file (see next section). You can check if a package is installed by typing `pip list` in the terminal. Note, that once you close the terminal or VSCode, the environment will be deactivated. You only need to activate the environment if you want to install or remove a package from your virtual environment. You can use it in your file even if the environment is not activated.
From now on, every package you install will be installed in the virtual environment and only available if you select the virtual environment for your Jupyter or Python file (see next section). You can check if a package is installed by typing `pip list` in the terminal. Note, that once you close the terminal or VSCode, the environment will be deactivated. You only need to activate the environment if you want to install or remove a package from your virtual environment. You can use it in your file even if the environment is not activated.

Copilot uses AI. Check for mistakes.
???+ warning
The virtual environment folder should never be touched by the user. Initially a clean copy of your global Python installation will be created.
This includes absolute paths to the Python installation and the Python executable.
Therefore the virtual environment folder **can not be moved** or sent to another machine.
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The warning box states that the virtual environment folder "can not be moved" but uses two words instead of one. While "can not" is technically acceptable, the more common and standard form is "cannot" (one word). For consistency and readability in technical documentation, "cannot" is preferred.

Suggested change
Therefore the virtual environment folder **can not be moved** or sent to another machine.
Therefore the virtual environment folder **cannot be moved** or sent to another machine.

Copilot uses AI. Check for mistakes.
Comment on lines +214 to +218
<div style="display: flex; justify-content: center; align-items: center; flex-direction: column; margin-bottom: 1rem;">
<div class="tenor-gif-embed" data-postid="23277809" data-share-method="host" data-aspect-ratio="1.33891" data-width="50%">
<a href="https://tenor.com/view/allergies-allergic-reaction-the-big-bang-theory-howard-wolowitz-peanut-reaction-gif-23277809">Allergies Allergic Reaction GIF</a>from <a href="https://tenor.com/search/allergies-gifs">Allergies GIFs</a>
</div>
<script type="text/javascript" async src="https://tenor.com/embed.js"></script>
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The newly added Tenor GIF embed loads third-party JavaScript from https://tenor.com/embed.js directly into your documentation page, executing untrusted code in the security context of your docs site. If the Tenor script is compromised or behaves maliciously, it can exfiltrate session cookies/tokens, modify page content, or run arbitrary actions on behalf of authenticated users viewing the docs. To reduce this supply-chain risk, avoid including third-party scripts directly and prefer safer alternatives (e.g., static media, server-side rendering, or vetted first-party bundles).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant