pypa / pypa/packaging.python.org
Create a discussion document about virtual environments
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 1.7k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 4
Description
Before you can start installing or using packages in your virtual environment you’ll need to activate it.
While a virtual environment is activated, pip will install packages into that specific environment.
Activating a virtual environment will put the virtual environment-specific
pythonandpipexecutables into your
shell'sPATH.
Could these parts be updated as well? They are incorrect and actively misleading, leading to a lot of misunderstandings. A virtual environment can be used without activation. It depends on how / which pip is used. It would be fantastic if this guide could explain that in slightly more detail: Explicitly explain that activating is only (one way of) putting the the virtual environment-specific python and pip executables into the current shell's PATH. Specifying that path explicitly is also possible and often easier, preferred, clearer, more robust. The leaky abstraction "activation" and the lack of such an explanation is mystifying things unnecessarily, and leads to many problems and much confusion.
- "Activation sucks as a method of switching environments" -- pfmoore
- "I use venvs extensively, but I never “activate” them." -- fungi
- "Why do we need to activate envs? One can always just env/bin/pip install whatever" -- bernatgabor
- "I have never once activated a virtual environment. I always use /full/path/to/venv/bin/python -m pip install …. And that’s what I teach to groups I mentor." -- ericvsmith
- ...
Originally posted by @petsuter in https://github.com/pypa/packaging.python.org/issues/1338#issuecomment-1793544750
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the guide passages quoted in the issue and read the linked discussions for context on activation and explicit interpreter paths. Done means the documentation explains that activation is optional, describes its PATH effect, and shows that an environment can be used by explicitly selecting its python or pip executable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100