Question 1
In a controlled system change, the engineer encounters: A Python application imports a module in the administrator interactive shell but raises ModuleNotFoundError when launched by a deployment service using a separate environment. What is the most appropriate targeted action?
Explanation
Correct Answer
The fix addresses the cause: global site-packages and a venv do not necessarily contain the same modules. A suitable acceptance test is that the deployment imports the module successfully from its intended Python environment.
Incorrect Answers
An administrator-level pip install may target a different interpreter or site-packages directory from the deployment service. The missing import must be solved in the environment that actually runs the application.
A global PYTHONPATH overrides isolation, may introduce incompatible dependencies, and does not create a reproducible install for the deployment interpreter.
Copying an isolated module tree ignores its packaging metadata and transitive dependencies. Installing the declared package into the service’s Python environment is the maintainable fix.





CompTIA Linux+ (XK0-006) Practice Tests