Overview
Theconda env create command creates a new conda environment from an environment definition file (typically environment.yml). This is the recommended way to create reproducible environments from a specification file.
Syntax
By default,
conda env create looks for a file named environment.yml in the current directory. Use -f to specify a different file.Target Environment Specification
Name of environment. Overrides the name specified in the environment.yml file.
Full path to environment location (i.e. prefix). Use this to create the environment at a specific location.
File Options
Environment definition file. Can be:
environment.yml- Conda environment specificationrequirements.txt- Pip-style requirements file- Any file supported by environment specifier plugins
Channel Customization
Additional channel to search for packages. Can be specified multiple times.
Use locally built packages. Identical to ‘-c local’.
Do not search default or .condarc channels. Requires
--channel.Environment Specifier Options
Specify which environment specifier plugin to use for parsing the environment file.
Solver Options
Choose which solver backend to use.
Platform Options
Target platform/subdir for the environment (e.g., linux-64, osx-64, win-64).
Package Options
Do not install default packages (specified in .condarc). Only install packages explicitly listed in the environment file.
Output and Prompt Options
Report all output as JSON. Suitable for using conda programmatically.
Only display what would have been done. Outputs the solved environment specification without actually creating the environment.
Sets any confirmation values to ‘yes’ automatically. If the environment already exists at the target location, it will be removed and recreated.
Can be used multiple times. Once for INFO, twice for DEBUG, three times for TRACE.
Do not display progress bar.
Networking Options
Use cache of channel index files, even if it has expired.
Allow conda to perform “insecure” SSL connections and transfers.
Offline mode. Don’t connect to the Internet.
Environment File Format
YAML Format (environment.yml)
The standard conda environment file uses YAML format:Requirements.txt Format
You can also use pip-style requirements.txt:Examples
Create environment from default file
environment.yml in the current directory.
Create with custom environment name
myenv, overriding the name in the file.
Create from specific file
Create from requirements.txt
Create at specific location
Dry run to preview changes
Create with additional channel
Create without default packages
Common Use Cases
Reproducible project environments
Reproducible project environments
Share environment.yml with your team for consistent environments:
Multi-platform environments
Multi-platform environments
Create environments that work across different platforms:The solver will automatically select appropriate packages for your platform.
Environments with environment variables
Environments with environment variables
Set environment variables automatically:
Mixed conda and pip dependencies
Mixed conda and pip dependencies
Combine conda and pip packages:
Development environments from GitHub
Development environments from GitHub
Create environments from files hosted online:
Behavior Notes
Name PriorityWhen both the file and command line specify a name:
- Command line
-n/--nametakes precedence - File’s
name:field is used if no command line name - If neither is specified, you must provide one
Troubleshooting
Unable to create environment - no name specified
Unable to create environment - no name specified
Ensure either:
- Your environment.yml has a
name:field - You provide
-nor-pflag
File not found
File not found
Check that the file exists and the path is correct:
Package conflicts
Package conflicts
Use
--dry-run to see what will be installed:Related Commands
conda env update- Update an existing environmentconda env export- Export environment to a fileconda create- Create environment from command lineconda env remove- Remove an environmentconda activate- Activate the created environment