Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Essential Commands for Anaconda and Conda Management

Tech 1

Core Conda Operations

Checking System Stattus

To verify the installed version, use:

conda -V

To access the help menu:

conda -h

Maintaining the Installer

Update the core package manager:

conda update conda

To downgrade to a specific releace:

conda install -n base conda=4.8.0

To remove the entire installation directory (Unix-based systems):

rm -rf /opt/anaconda3

Managing Environments

Initialization

To spin up a new isolated workspace:

conda create --name project_alpha python=3.9

Navigation

Activate the target workspace:

conda activate project_alpha

Return to the base system or previous environment:

conda deactivate

Inventory and Removal

List all available environments:

conda env list

Delete an environment by name:

conda env remove --name project_alpha

Duplicate an existing environment:

conda create --name project_beta --clone project_alpha

Package Management

Inspection

List installed packages in the active context:

conda list

Check packages in a specific context:

conda list -n project_alpha

Installation and Removal

Install specific libraries:

conda install numpy pandas

Install a fixed version:

conda install --name project_alpha scipy==1.5.2

Remove a library:

conda remove scipy

Searching Repositories

Search for exact matches:

conda search --full-name numpy

Perform partial matches:

conda search scikit

Channel Configuration

Viewing and Modifying Sources

Display active channels:

conda config --show channels

Add a custom mirror (e.g., Conda-Forge):

conda config --add channels conda-forge

Remove a channel:

conda config --remove channels conda-forge

Display channel URLs in output:

conda config --set show_channel_urls true

Environment Serialization

YAML Format

Export the active environment details:

conda env export > environment_spec.yml

Recreate an environment from a YAML file:

conda env create -f environment_spec.yml --name restored_env

Text Requirements

Export package list to a text file:

conda list --explicit > requirements.txt

Install pakcages from a file:

conda install --file requirements.txt --yes

Automation

Use the -y flag to bypass manual confirmation prompts during installation or environment creation.

Example:

conda create --name auto_env python=3.8 -y

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.