Automation, Orchestration, and Scripting
An administrator on Ubuntu Server must isolate a Python tool's dependencies in ~/proj/.venv and install the packages listed in requirements.txt. Which four actions are part of this procedure? (Choose four.)
Choose 4 answers
Show the answer
Correct answersA. Run python3 -m venv ~/proj/.venv to create the environment directoryB. Install the python3-venv package if the distribution does not ship ensurepip with the default PythonC. Run source ~/proj/.venv/bin/activate to place the environment's bin directory first in PATHD. Run pip install -r requirements.txt while the environment is active
venv is built in, may need python3-venv on Debian-based systems, is created with python3 -m venv, activated by sourcing activate, and pip then installs from the file. Running activate as a script fails because a child process cannot change the parent shell's PATH.