1. Home
  2. Data Science
  3. Python
  4. Which command creates a virtual environment in Python?

Added 25 Nov 2026

Which command creates a virtual environment in Python?

  1. python -m venv env Correct answer
  2. pip venv env
  3. python create env
  4. venv install env

Correct answer

A. python -m venv env

MCQSEXAM

Explanation

python -m venv <name> creates a virtual environment.

Reference

Asked in: Python Interview Advanced Python

https://docs.python.org/3/library/index.html

Preparing for an exam?

Doubts & discussion

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