It is generally not recommended to install packages globally in a virtual environment as it defeats the purpose of creating a separate environment with unique dependencies. However, if you really want to install packages globally in a virtual environment, you can do so by activating the virtual environment and using the system's package manager (e.g. apt for Ubuntu):
source path/to/venv/bin/activate
sudo apt install package-name
This will install the package globally on the system, but it will be available in the virtual environment as well since it is activated. However, it is recommended to use the virtual environment's package manager (e.g. pip) to install packages within the virtual environment.
Asked: 2023-05-25 03:20:47 +0000
Seen: 13 times
Last updated: May 25 '23