Services and User Management

On a Debian-based server, an administrator runs pip install requests and receives the error "externally-managed-environment". The script needs requests without altering packages managed by apt. What is the BEST approach?

Show the answer

Correct answerA. Create a virtual environment with python3 -m venv and run pip from inside it

A virtual environment gives pip an isolated location, so the system Python and apt-managed packages stay untouched. Using sudo is tempting, but it does not lift the restriction and would risk overwriting distribution-managed files. Upgrading pip does not remove the marker restriction.