You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
It does indeed refer to being in a shell with the virtual environment active.
The directory where you are is not relevant; Python install tools do not put things in the current directory (like npm or others) for now, but always into a site-packages directory (system, virtualenv or user-specific).
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)
:"
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.
"
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!
The text was updated successfully, but these errors were encountered: