base
or a “base environment”. This environment is where conda itself is installed, and should only be used for installing anaconda, conda, and conda-related packages, such as anaconda-client
or conda-build
.
For your projects, however, Anaconda strongly recommends creating new environments to work in. This protects your base environment from breaking due to complex dependency conflicts and allows you to easily manage and reproduce your environment on other machines.
Example version matching inputs
python=3.12.1
- Matches the package with the exact name and version specified.
python>=3.11
- Matches any version of the package that is greater than or equal to the version specified.
python<=3.12
- Matches any version of the package that is less than or equal to the version specified.
python>3.10,<3.12
- Matches any version of the package between the specified versions, but excludes the specified versions.
python>=3.10,<=3.12
- Matches any version of the package between the specified versions, including the specified versions.
python[version='3.12.*']
- Matches any version of the python package that starts with 3.12.
Environment registration
environments.txt
file, which is located here:%USERPROFILE%\.conda\environments.txt
conda --info envs
uses the environments.txt
file to show all existing environments on your machine, even those outside the base install directory.Operating System | Installer | Default Environment Location |
---|---|---|
Windows | Graphical installer (.exe ) |
|
macOS | Graphical installer (.pkg ) |
|
macOS | Command line installer (.sh ) |
|
Linux | Command line installer (.sh ) |
|
--prefix
command when creating an environment, or by updating your .condarc
file to contain the envs_dirs:
key.
conda-project
package to be installed in the environment you want to lock. Install the package by running the following commands:
environment.yml
file, create one by running the following command:
conda-lock.default.yml
file that you can export to share with others.
.yml
file.
.yml
file.yml
file in your current directory, it will be overwritten during the export process.environment.yml
file populates in your current working directory..yml
file with another user.
conda activate my_env1
, followed by conda activate my_env2
, and then run conda deactivate
, conda returns to the my_env1
environment.conda remove
deletes and your environment.environments.txt
file (see Environment registration).To manually delete and deregister an environment directory properly, run one of the following commands, depending on your operating system and conda installation: