conda Verified current stable Not installed? Package Management

Conda / List Packages Installed Path

List Packages Installed Path

Lists all installed packages in the specified conda environment by path.

$
Terminal
conda list -p <path/to/environment>

When To Use

When verifying the contents of an environment directory or for backup purposes.

Pro Tip

Use `--export` to create a consumable list for environment recreation.

Command Builder

Tune the command before you copy it

Back to syntax
$
Generated Command
conda list -p <path/to/environment>

Terminal Output

Expected runtime feedback

Simulated preview
>
Output
# Name                    Version                   Build  Channel
numpy                    1.21.2                   py39hec16c3e_0    -
scipy                    1.7.1                    py39hcdab131_0    -
pandas                   1.3.3                    py39he4d9d1a_0    -
matplotlib               3.4.3                    py39hf3d5a2f_0    -

Anatomy of Output

Understanding the result

# packages in environment /home/user/miniconda3/envs/my_env: numpy=1.18.1 pandas=1.0.0 Path-based Package List

Displays all packages with versions in the defined directory.

Power User Variants

Optimized versions

conda list -p /path/to/valid/env

Lists packages for a valid environment path.

conda list -p /home/user/miniconda3/envs/another_env --export

Outputs package list for export.

Troubleshooting

Common pitfalls

EnvironmentNotFoundError: The environment does not exist at 'given_path'.

Solution: Check if the provided path is correct.

PackageNotFoundError: Package 'abc' does not exist in the environment.

Solution: Install the specified package using 'conda install abc'.

OSError: [Errno 2] No such file or directory: 'invalid_path'.

Solution: Ensure the specified path exists.

Command Breakdown

What each part is doing

conda
Base Command
The executable that performs this operation. Here it runs Conda before the shell applies any redirect operators.
-p
p| prefix
The value supplied for p| prefix.
<path/to/environment>
path to environment
The value supplied for path to environment.
-p
Command Option
Tool-specific option used by this command invocation.

How To Run

Execution path

  1. Step 1

    Run the command: `conda list -p path/to/environment`

  2. Step 2

    Verify the output displays the list of installed packages and their versions.

Alternative Approaches

Comparable commands in other tools

Alternative package management tools for the same job.