1. Home
  2. Data Science
  3. Python
  4. What is the purpose of the '--no-site-packages' flag when…

Added 10 Feb 2024

What is the purpose of the '--no-site-packages' flag when creating a virtual environment in Python?

  1. To prevent the installation of third-party packages
  2. To use the system-wide Python packages
  3. To exclude site-specific packages from the virtual environment Correct answer
  4. To disable the use of the 'site-packages' directory

Correct answer

C. To exclude site-specific packages from the virtual environment

20 views

MCQSEXAM

Explanation

The '--no-site-packages' flag is used when creating a virtual environment in Python to exclude the system-wide site-packages directory from the virtual environment. This ensures that the virtual environment is isolated from the system-wide Python installation and only contains the packages installed specifically for that environment.

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs