How-To: Using Anaconda - Backup a Virtual Conda Environment Configuration via Command Line Interface

Summary

Backup a Conda Environment Configuration via Command Line Interface into a YAML formatted file.

Body

Question

How do I backup a virtual conda environment configuration from the Command Line?

 

Answer

Note:  This does not backup folders or files being used in the environment, only the configuration into a YAML formatted file.

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 or Terminal command line (CLI) in an active virtual​​​​​​​ conda environment, enter "conda env export > environment.yml".  Environment configuration is placed in the environment.yml file.

command prompt window in my_test_venv_3_13 virtual environment with "conda env export > environment.yml"

 

2. Contents of the example environment.yml file: 

name: my_test_env_3_13
channels:
  - defaults
  - pkgs/main
dependencies:
  - blas=1.0=mkl
  - bzip2=1.0.8=h2bbff1b_6
  - ca-certificates=2025.12.2=haa95532_0
  - intel-openmp=2025.0.0=haa95532_1164
  - libexpat=2.7.4=hd7fb8db_0
  - libffi=3.4.4=hd77b12b_1
  - libhwloc=2.12.1=default_hfa10c62_1000
  - libiconv=1.18=hc89ec93_0
  - libmpdec=4.0.0=h827c3e9_0
  - libxml2=2.13.9=h6201b9f_0
  - libzlib=1.3.1=h02ab6af_0
  - mkl=2025.0.0=h5da7b33_930
  - mkl-service=2.5.2=py313h0b37514_0
  - mkl_fft=2.1.1=py313hbc2a22c_0
  - mkl_random=1.3.0=py313h42c1672_0
  - numpy=2.4.3=py313h22cce72_0
  - numpy-base=2.4.3=py313h1df51cf_0
  - openssl=3.5.5=hbb43b14_0
  - packaging=25.0=py313haa95532_1
  - pandas=3.0.1=py313hf6ff4c0_0
  - pip=26.0.1=pyhc872135_0
  - python=3.13.12=h39c999c_100_cp313
  - python-dateutil=2.9.0post0=py313haa95532_2
  - python-tzdata=2025.3=pyhd3eb1b0_0
  - python_abi=3.13=3_cp313
  - setuptools=80.10.2=py313haa95532_0
  - six=1.17.0=py313haa95532_0
  - sqlite=3.51.2=hee5a0db_0
  - tbb=2022.3.0=h90c84d6_0
  - tbb-devel=2022.3.0=h90c84d6_0
  - tk=8.6.15=hf199647_0
  - tzdata=2026a=he532380_0
  - ucrt=10.0.22621.0=haa95532_0
  - vc=14.3=h2df5915_10
  - vc14_runtime=14.44.35208=h4927774_10
  - vs2015_runtime=14.44.35208=ha6b5a95_10
  - wheel=0.46.3=py313haa95532_0
  - xz=5.8.2=h53af0af_0
  - zlib=1.3.1=h02ab6af_0
prefix: C:\Users\trumant\miniconda3\envs\my_test_env_3_13

Details

Details

Article ID: 2211
Created
Wed 3/25/26 11:10 AM
Modified
Tue 5/5/26 5:13 PM

Related Articles

Related Articles (4)

Add a Channel in a Conda Environment in Anaconda Navigator
A central guide for researchers to build stable and high-performance coding environments using the Conda ecosystem. It brings together best practices—such as choosing the right distribution and using "blueprints" to share work—to help you avoid technical conflicts and ensure your research can be perfectly recreated by others. By following these strategies, you can protect your productivity and make your software projects both portable and reliable.
To make your work reliable and easy to share, this article recommends using a special blueprint file (called environment.yml) to list all the software tools your project needs. By using this file, anyone can recreate your exact workspace with a single command, ensuring your code runs the same way on every computer. Keeping your projects in their own separate folders and "freezing" your settings when finished prevents future updates from breaking your work.
Index of Miniconda How-To Articles for Virtual Conda Environments