QuizzesInstalling Python, pip & Virtual Environments — Concept Check
intermediate
python

Installing Python, pip & Virtual Environments — Concept Check

Questions on Installing Python, pip & Virtual Environments. Every real Python project isolates its dependencies in a virtual environment (venv) and installs packages with pip — the #1 habit that separates beginners from professionals.

8 minutes 8 questions Pass at 70%
Time Limit
8 minutes - timer starts when you begin
Change Answers Freely
Revisit and change any answer before submitting
Full Review After Submit
Correct answers and explanations shown for every question
Auto-submit on timeout
Quiz submits automatically when time runs out

Questions in this quiz

8 questions on Installing Python, pip & Virtual Environments — Concept Check. Work through them here, then start the quiz to answer them and see your score.

  1. 1.A developer installs packages globally and notices conflicts between projects. What should they do to prevent this?

    • APin dependencies in requirements.txt
    • BUse virtual environments for each project
    • CInstall packages in the system Python
    • DUse the same package versions for all projects
  2. 2.You created a virtual environment and installed packages, but `pip freeze` shows no output. What might be wrong?

    • AThe pip version is outdated
    • BThe requirements.txt file is empty
    • CPackages were installed globally
    • DThe virtual environment is not activated
  3. 3.After running `pip install -r requirements.txt`, a package version mismatch occurs. What is a likely cause?

    • AThe virtual environment was not activated
    • BThe requirements.txt file was not committed
    • CThe package was installed globally
    • DThe wrong Python version is used
  4. 4.A developer finds that `which python` points to a system Python, not the virtual environment. What should they do?

    • AEdit the PATH variable manually
    • BReinstall Python
    • CActivate the virtual environment
    • DUse `pip install` to fix it
  5. 5.A teammate claims they don't need virtual environments because they use `requirements.txt`. What's the flaw in this reasoning?

    • AVirtual environments slow down development
    • BVirtual environments are optional
    • CRequirements.txt is only for servers
    • DRequirements.txt doesn't prevent global installs
  6. 6.Why is it important to never commit the venv folder to version control?

    • AIt is automatically generated
    • BIt contains system-specific paths
    • CIt increases repository size
    • DIt can cause merge conflicts
  7. 7.A developer activates a virtual environment but `pip --version` shows a system path. What might be the issue?

    • AThe virtual environment is not properly activated
    • BThe virtual environment was deleted
    • CThe pip version is outdated
    • DThe Python version is incorrect
  8. 8.What is the main purpose of using `pip freeze > requirements.txt` in a project?

    • ATo save exact package versions for reproducibility
    • BTo activate the virtual environment
    • CTo install packages globally
    • DTo update all packages to the latest version