GeezerVison is showing github.com — Add a note to the `venv` documentation that users should **not** put their code _inside_ the virtual environment · Issue #109414 · python/cpython
Add a note to the venv documentation that users should **not** put their code _inside_ the virtual environment #109414
Description
Documentation
The venv docs don't explicitly call out that the virtual environment directory should be viewed as self-contained unit and not as a directory to place one's own code.
Linked PRs
Activity
brettcannon commented on Sep 14, 2023
vsajip commented on Sep 14, 2023
There is an admonition:
Because of this, environments are inherently non-portable, in the general case. You should always have a simple means of recreating an environment (for example, if you have a requirements file requirements.txt, you can invoke pip install -r requirements.txt using the environment’s pip to install all of the packages needed by the environment).
I don't object to adding more information, but doesn't this
virtual environment directory ... and not as a directory to place one's own code.
come under the "bleedin' obvious" category?
brettcannon commented on Sep 14, 2023
doesn't this
virtual environment directory ... and not as a directory to place one's own code.
come under the "bleedin' obvious" category?
That's what I thought, but based on https://mastodon.social/@fschulze/111053590685791015 and the amount of people we are running into with VS Code who are getting upset we don't format code we find in a virtual environment because we treat it as outside of a user's domain, it apparently isn't getting out enough into the general community.
added 2 commits that reference this issue
on Sep 15, 2023gh-109414: Add some basic information about venvs in the introduction. (
Metadata
Metadata
Development
No branches or pull requestsIssue actions