Home >Backend Development >Python Tutorial >How to create a new virtual environment in conda

How to create a new virtual environment in conda

小老鼠
小老鼠Original
2023-12-04 16:50:595967browse

Method to create a new virtual environment: 1. Use “conda create --name your_env_name " command to create a new virtual environment in Conda; 2. Create a virtual environment named myenv, you can run the "conda create --name myenv" command; 3. Create a virtual environment named myenv and install it in it Python 3.8 version, you can add python=3.8 after the two methods command

How to create a new virtual environment in conda

## Operating system for this tutorial: Windows 10 system, Python 3.11.4 version. Dell G3 computer.

Everyone is watching recently

[shoudongurl]

How to switch conda environments[/shoudongurl]

[shoudongurl]

How to install tensorflow in conda[/shoudongurl]

[shoudongurl]

How to delete the environment in conda[/shoudongurl]

[shoudongurl]

How to view the environment in conda[/shoudongurl]

You can use the following command to create a new virtual environment in Conda:

conda create --name your_env_name
In this command, your_env_name is the value you want The name to give the virtual environment. For example, if you want to create a virtual environment named myenv, you can run the following command:

conda create --name myenv
You can also specify a specific version to install in the new environment. Python. For example, to create a virtual environment named myenv and install the Python 3.8 version in it, you can run the following command:

conda create --name myenv python=3.8
After creating the virtual environment, you can activate the environment and install all required package. To activate the virtual environment, you can use the following command:

On Windows:

activate myenv
On macOS and Linux:

source activate myenv

The above is the detailed content of How to create a new virtual environment in conda. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn