pypa / pypa/packaging.python.org

More accurate guidance: what is the meaning of "you're in your virtual environment" ?

Aperta
#741 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Python
Stelle
1.7k
Fork
1.7k
Merge medio
3g 12h
PR unite (30g)
4

Descrizione

Hi,

As a newbie, I would like to read more accurate descriptions.
e.g.
"Installing packages
Now that you're in your virtual environment you can install packages. Let's install the Requests library from the :term:Python Package Index (PyPI):
"

  • Does this mean that
    a) the command shell's current directory needs to be set to the virtual environment's directory (if yes: exactly which directory?)
    or
    b) the meaning is that kind of I've been logged in to this virtual environment (and doesn't matter where the current directory is, even it can be changed to any other virtual environment's directory) and the commands are served/ran by the bins in the activated virtual environment?

n.b. 'logged in' is quite an abstract phrase here - meaning something like locked, bound, activated - still learning the phrases :-)
---edit---
I found this
https://docs.python.org/3/library/venv.html#module-venv
"You don’t specifically need to activate an environment; activation just prepends the virtual environment’s binary directory to your path, so that “python” invokes the virtual environment’s Python interpreter and you can run installed scripts without having to use their full path. However, all scripts installed in a virtual environment should be runnable without activating it, and run with the virtual environment’s Python automatically.
"

  • So, an activated virtual environment is not something like logged in, as far as I understand actually it's something very weak, it's a temporal change of PATH (until deactivate is run)

Also, a description (diagram, maybe) of the process/flow of activating-using-deactivating virtual environments would shed light here, e.g. what is changed under the hood, what variables are affected, how a command and its path is interpreted. Maybe that belongs to another topic.

Thanks!

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con il passaggio «Installing packages» citato nell’issue e confrontane la formulazione con la documentazione di venv di Python all’URL collegato. Chiarisci cosa cambia con l’attivazione, come la directory corrente è collegata all’ambiente e se in questo argomento è opportuno inserire un diagramma; il lavoro sarà considerato completato quando una persona alle prime armi potrà comprendere il flusso di attivazione, utilizzo e disattivazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
documentation
Tipo di issue
Documentazione
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.