How-To: Using Anaconda - Install a Package in a Virtual Conda Environment via Command Line Interface

Question

How do I install a package in a virtual conda environment from the Command Line?

 

Answer

Note:  To activate an environment from the command line, see "How-To: Using Anaconda - Activate a Virtual Conda Environment via Command Line Interface"

1. From the Anaconda Prompt command line (CLI) in an active virtual conda environment, enter "conda list" to list installed packages.

Example environment: venv_3_13

command prompt window in venv_3_13 virtual environment with "conda list" as an example

 

2. Add new package.

a. Enter "conda install <package_name>". The below three screenshots show the output of installation of the example package.

Example package: pandas

b. A prompt to proceed will be displayed and require "y".

c. The new package is added.

Anaconda prompt with "conda install pandas" on command line

Anaconda Prompt with question to proceed with installation.

Anaconda Prompt with completion of package installation.

 

3. Enter "conda list" again to verify package was installed. Example package highlighted.

Example package: pandas

Anaconda Prompt with "conda list" and packages listed.