ACP Package Management & Environment Configuration — Questions and Answers
Question 1: Which command is used to create a new virtual environment in Anaconda?
- pip install
- conda create (Correct answer)
- virtualenv new
- python -m venv
Correct answer: conda create
The `conda create` command allows users to create isolated virtual environments with specific dependencies.
Question 2: What is the purpose of a Conda environment?
- To uninstall packages globally
- To manage dependencies and isolate projects (Correct answer)
- To delete Python installations
- To force package updates system-wide
Correct answer: To manage dependencies and isolate projects
Conda environments help users manage dependencies, prevent conflicts, and isolate project-specific packages.
Question 3: Which command lists all installed packages in a Conda environment?
- conda show
- conda list (Correct answer)
- pip freeze
- conda packages
Correct answer: conda list
The `conda list` command displays all installed packages within the active Conda environment.
Question 4: What is an advantage of using Conda over pip?
- Conda supports multiple programming languages (Correct answer)
- Conda does not handle dependencies
- Pip provides better dependency resolution
- Conda is only for machine learning projects
Correct answer: Conda supports multiple programming languages
Conda manages packages and dependencies across multiple languages, whereas pip is limited to Python packages only.
Question 5: How can a user switch to an existing Conda environment?
- conda use
- conda activate (Correct answer)
- conda start
- conda enter
Correct answer: conda activate
The `conda activate` command allows users to switch to a specific Conda environment for package management and execution.
Question 6: Which file is used to export a Conda environment configuration?
- requirements.txt
- environment.yml (Correct answer)
- setup.py
- conda.config
Correct answer: environment.yml
The `environment.yml` file allows users to export and share Conda environments with dependencies for consistent setups.
Which command is used to create a new virtual environment in Anaconda?