How to create new env in anaconda
To create a new environment in Anaconda, you can use the conda
command in your terminal or command prompt. Here are the steps:
Method 1: Using conda create
-
Open your terminal or command prompt.
-
Type the following command to create a new environment:
conda create --name myenv
Replace
myenv
with the name you want to give your new environment. -
Press Enter to create the environment. This may take a few seconds.
Method 2: Using conda env
-
Open your terminal or command prompt.
-
Type the following command to create a new environment:
conda env create --name myenv
Replace
myenv
with the name you want to give your new environment. -
Press Enter to create the environment. This may take a few seconds.
Method 3: Using Anaconda Navigator
- Open Anaconda Navigator.
- Click on the "Environments" tab.
- Click on the "Create" button.
- Enter the name of your new environment and click "Create".
Activating the new environment
Once you've created the new environment, you'll need to activate it before you can start using it. To activate the environment, use the following command:
conda activate myenv
Replace myenv
with the name of your new environment.
You should see the name of the environment printed in your terminal or command prompt, indicating that you're now working in that environment.
Deactivating the environment
To deactivate the environment and return to your base environment, use the following command:
conda deactivate
This will return you to your base environment, where you can continue working as usual.
That's it! You've successfully created a new environment in Anaconda.