pypa / pypa/packaging.python.org
Create a discussion document about virtual environments
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 1.7k
- Fork
- 1.7k
- Merge medio
- 3g 12h
- PR unite (30g)
- 4
Descrizione
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
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Individua i passaggi della guida citati nell’issue e leggi le discussioni collegate per comprendere il contesto relativo all’attivazione e ai percorsi espliciti dell’interprete. Il lavoro è completato quando la documentazione spiega che l’attivazione è facoltativa, descrive il suo effetto su PATH e mostra che è possibile usare un ambiente selezionando esplicitamente il relativo eseguibile python o pip.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- documentation
- Tipo di issue
- Documentazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100