1. Home
  2. Data Science
  3. Python
  4. What is the purpose of the '--user' flag when installing…

Added 10 Feb 2024

What is the purpose of the '--user' flag when installing Python packages using pip?

  1. To install packages globally for all users
  2. To install packages for the current user only Correct answer
  3. To specify the version of the package to install
  4. To install packages in a specific directory

Correct answer

B. To install packages for the current user only

23 views

MCQSEXAM

Explanation

The '--user' flag in pip is used to install Python packages for the current user only, rather than globally for all users. This is useful when you do not have administrative privileges on the system or when you want to install packages without affecting other users or the system-wide Python installation.

Doubts & discussion

Not sure why the answer is B? 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