β
Virtual environments are typically created within a directory containing a specific structure that includes a separate Python interpreter and a set of directories for package installations and other resources. Each virtual environment contains its own copy of the Python interpreter executable. This ensures that when the virtual environment is activated, it uses its own interpreter rather than the system-wide one. Additionally, virtual environments include their own directories for installing Python libraries and packages. When you install a package within a virtual environment using pip or another package manager, the packages are installed into this isolated directory structure, separate from other environments. Installation of packages and managing dependencies will be covered in the following chapter.
β
β