Skip to main content
v2026.11,986 entries · CC-BY 4.0

Conda Make New Environment: conda create for Research Projects

How to make a new conda environment with conda create: name vs path, pinning Python, environment.yml, cloning, activation and documented fixes.

Written and maintained by CASRAI Editorial Board

Published · Last updated

On this page

To make a new conda environment, run conda create --name myenv (or -n myenv) in a terminal; conda creates an empty environment called myenv, and conda activate myenv switches the current terminal session into it. Name the packages and the Python version in the same command, for example conda create -n analysis python=3.12 numpy, so conda solves all the dependencies together and the environment is a known starting point for a research project.

What it is used for in research

A conda environment is an isolated directory of installed packages. Research code depends on specific versions of Python, numerical libraries and analysis packages, and two projects rarely agree on those versions. Giving each project its own environment keeps an upgrade for one analysis from changing the results of another, and it gives a collaborator or reviewer something concrete to rebuild. The same command works whether you say “make a new conda environment” or “create a conda environment”: the command is always conda create.

This page covers creating the environment. Keeping it reproducible after creation (exporting, sharing and rebuilding) is covered in sharing a reproducible conda environment, and mixing pip into an environment is covered in conda, pip and mamba in one environment.

How to install or access it

The conda command ships with the distributions that include it. If you have not installed one yet, the step-by-step is in install Anaconda Python for Windows, macOS and Linux. The reference for every option on this page is the official conda documentation for conda create at docs.conda.io (listed under Sources). Since conda 23.10.0 the default solver is conda-libmamba-solver, announced on the conda project’s release blog; if you need the older behaviour you can pass --solver=classic. If conda itself is out of date, see updating conda first.

Check the install by opening a terminal and running conda env list (the same listing is available as conda info --envs). It prints every environment conda knows about, and the environment you are currently in is marked with an asterisk.

Step-by-step: make a new conda environment

1. Create the environment

  1. Open a terminal where conda works.
  2. Create the environment by name. The documentation gives the bare form as conda create --name my-env. Run on its own it makes an empty environment: “No packages will be installed in this environment.”
  3. Prefer to put the packages in the same command. The documentation’s examples include conda create -n myenv python=3.9, conda create -n myenv scipy=0.17.3 and conda create -n myenv python=3.9 scipy=0.17.3 astroid babel. The documentation’s advice is to install all the programs you want in the environment at the same time, because installing them one at a time can lead to dependency conflicts.
  4. Confirm the prompt, or add -y (--yes) to skip it. To see what conda would do without doing it, add -d (--dry-run), which only displays what would have been done.
  5. Activate it with conda activate myenv. Activation affects the current terminal session only and puts the environment’s directories at the front of PATH, so a second terminal window is not in the environment until you activate there too.
  6. Check the result with conda env list; the active environment carries the asterisk.

2. Worked example for a research project

Suppose you are starting a new analysis of survey or instrument data and want a clean workspace. The package names below are generic placeholders for whatever your project needs; the command pattern is the one the documentation shows.

conda create -n analysis python=3.12 numpy pandas matplotlib
conda activate analysis
conda env list

The Python version is pinned inside the package specification (the documentation’s own form is conda create -n myenv python=3.12 numpy), and every package is requested in one command. Record that command in your project notes or README. It is the first line of your computational methods, and it is what a reviewer needs to rebuild the same starting point.

3. Make a new conda environment by name vs by path

There are two ways to say where the environment goes. -n/--name takes the name of the environment and places it in conda’s default environments folder. -p/--prefix takes the full path to the environment location. The documentation requires one of the two unless you pass --dry-run or --download-only.

The path form is useful when you want the environment to live inside a project folder. The documentation’s example is conda create --prefix ./envs jupyterlab=3.2 matplotlib=3.5 numpy=1.21, followed by conda activate ./envs. The catch: --name cannot find environments outside the default folder, so an environment made with --prefix elsewhere is activated by its path, not by a name.

4. Create from a file or clone an existing environment

Two other inputs create a new environment without typing the package list. To build from a file, use -f/--file: the option reads “environment or package specs from a file”, and the file format is auto-detected (use --format for a custom file name). A minimal environment.yml from the documentation has a name, a channels list (the example uses conda-forge) and a dependencies list (the example lists python and numpy). Create from it with conda create --file environment.yml. The older conda env create --file still works but is no longer the preferred form.

To copy an environment you already have, use --clone: conda create --name myclone --clone myenv. The documentation describes this as creating a new environment as a copy of an existing local environment, which is a safe way to try a package upgrade without touching the working environment.

5. Choose channels and remove environments

If a package is not found in the default channels, add the channel with -c (--channel), which adds a channel to search for packages. -O/--override-channels does the opposite: it skips the default and .condarc channels and requires --channel. To delete an environment you no longer need, the documentation gives conda remove --name myenv --all or conda env remove --name myenv.

Output and how to read it

The result of conda create is a new environment, not a file you open. Read it in three places. First, the --dry-run output: run the command with -d and conda only displays what would have been done, so you can review the plan before anything is installed. Second, conda env list (or conda info --envs), which lists every environment, with the active one marked *. If the asterisk is not on the environment you expect, you have not activated it in this terminal. Third, the environment’s own contents once active: an environment made with no packages is empty by design, so a missing library means it was never requested.

The data table below lists the four input routes (name, prefix, file, clone) with the option, an example command and the limit the documentation states for each.

Troubleshooting

The conda troubleshooting page documents the failures below; the fixes shown are the documented ones.

UnsatisfiableSpecifications

The message starts “The following specifications were found to be in conflict:” and lists the packages that cannot coexist. The documented approach is to inspect the packages with conda search PACKAGE --info and then change your request, for example by relaxing a version pin. This is also why the single-command advice matters: requesting everything together lets conda see the whole constraint set.

A package cannot be found

Search for it, and if it lives on another channel, add that channel with -c CHANNEL. The documentation notes that community channels are not officially endorsed by conda, so check who maintains one before depending on it for published work.

CondaHTTPError or “SSL module not available” on Windows

The documentation lists CondaHTTPError: HTTP 000 CONNECTION FAILED and the SSL module message, with causes including missing OpenSSL libraries and an environment that has not been activated. It also documents conda config --set ssl_verify truststore as a configuration route for certificate problems.

Windows batch scripts

In a Windows batch script, the documentation says to put CALL in front of conda commands (for example CALL conda activate myenv).

The shell still runs the old program

If a command seems to run an older copy after an install, the documentation recommends clearing the shell’s command lookup cache: hash -r in bash or rehash in zsh.

Free alternatives

If conda create is not the right tool, two documented alternatives create isolated environments. The table summarises what the official documentation of each says about creating one.

Tool Command to create How you activate it What its documentation says
conda conda create -n myenv python=3.12 numpy conda activate myenv Installs packages and Python itself; environments by name or by path.
micromamba micromamba create -p /tmp/env pytest See the micromamba guide A statically linked C++ executable with its own command line interface; no base environment and no default Python. mamba and micromamba share a code base.
venv (Python standard library) python -m venv /path/to/new/virtual/environment POSIX bash/zsh: source VENV/bin/activate; Windows cmd: VENV\Scripts\activate.bat; PowerShell: VENV\Scripts\Activate.ps1 Activation is optional; deactivate leaves the environment. The Python documentation says venv is the recommended way since Python 3.5.

For a side-by-side view of conda and mamba see Mamba vs Conda.

Frequently asked questions

How do I make a new conda environment?

Run conda create --name myenv, then conda activate myenv. Add the packages and Python version to the same command, such as conda create -n myenv python=3.12 numpy, so the dependencies are solved together.

How do I create a conda environment with a specific Python version?

Put the version in the package specification: conda create -n myenv python=3.9. The documentation uses this pattern for Python and for other packages, such as scipy=0.17.3.

What is the difference between –name and –prefix?

--name uses conda’s default environments folder, while --prefix takes a full path, so the environment can live anywhere, for example inside a project folder. An environment created by prefix elsewhere is activated by its path.

Can I make a new conda environment from a file?

Yes. conda create --file environment.yml reads the specification, and the documentation notes that conda env create --file still works but is no longer preferred.

Does activation last after I close the terminal?

No. Activation affects the current terminal session only.

How do I delete a conda environment?

Use conda remove --name myenv --all or conda env remove --name myenv.

Sources

Data: Ways to create a new conda environment: input routes and when each applies

Compares the conda create input routes (name, prefix, file, clone) by option, example command and the activation or limit the official conda documentation states for each. Compiled from the conda create reference and the Managing environments guide.

Ways to create a new conda environment: input routes and when each applies
RouteOptionExample commandWhat the documentation says
By name-n / --nameconda create --name myenv python=3.9Name of environment; with no packages given it creates an empty environment.
By path (prefix)-p / --prefixconda create --prefix ./envs jupyterlab=3.2 matplotlib=3.5 numpy=1.21Full path to environment location; activate with conda activate ./envs, because --name cannot find environments outside the default folder.
From a file-f / --fileconda create --file environment.ymlReads environment or package specs from a file; format auto-detected, --format for custom names.
Clone--cloneconda create --name myclone --clone myenvCreates a new environment as a copy of an existing local environment.

Sources

Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about Conda Make New Environment: conda create for Research Projects

2 free questions a day, no account.

An AI assistant for research: funder rules, compliance, methods and publishing. It links the sources behind its answers and labels answers that come from a web search.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays open to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →