Conda / List Info Environment Variables
List Info Environment Variables
Shows information regarding environment variables within the conda setup.
conda info -s conda info -s #!/bin/bash
# List Info Environment Variables
conda info {{[-s|--system]}} import subprocess
# List Info Environment Variables
# Make sure to replace <placeholders> with actual values
def run_command():
cmd = [
"conda",
"info",
"-s"
]
try:
print(f"Executing: {' '.join(cmd)}")
subprocess.run(cmd, check=True)
except subprocess.CalledProcessError as e:
print(f"Error: {e}")
except FileNotFoundError:
print("Error: conda not found. Please install it first.")
if __name__ == "__main__":
run_command() When To Use
For troubleshooting environmental variable issues in automated setups.
Pro Tip
Execute `conda info -s` for a concise summary of the system configuration.
Terminal Output
Expected runtime feedback
active environment : base
active env location : /home/user/miniconda3/envs/base
shell level : 1
user config file : /home/user/.condarc
populated config files : /home/user/miniconda3/.condarc
conda version : 4.10.3
conda-build version : 3.21.4
python version : 3.9.5
virtual packages :
base environment : /home/user/miniconda3 Anatomy of Output
Understanding the result
CONDA_EXE = /home/user/miniconda3/bin/conda Conda Executable Path to the conda executable.
PATH = /home/user/miniconda3/bin:/usr/local/sbin:/usr/local/bin System Path Lists directories in the PATH environment variable.
CONDA_ENV_PATH = /home/user/miniconda3/envs Environment Path Location where conda environments are stored.
Power User Variants
Optimized versions
conda info -s -e Show environment variables with environment information.
Troubleshooting
Common pitfalls
No such file or directory: CONDA_EXE not set.
Solution: Check conda installation for corruption.
KeyError: 'PATH' not found.
Solution: Reinitialize shell or ensure conda is initialized.
EnvironmentError: Path is not set correctly.
Solution: Verify PATH configuration in your shell.
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.
-
-s - s| system
- The value supplied for s| system.
-
-s - Command Option
- Tool-specific option used by this command invocation.
How To Run
Execution path
- Step 1
Run the command: `conda info --system`
- Step 2
Check for active environment and path in the output.
- Step 3
Ensure expected versions align with your project needs.
Alternative Approaches
Comparable commands in other tools
Alternative package management tools for the same job.