How to Create Virtual Environment in Anaconda | Python

How to Create Virtual Environment in Anaconda

To create an environment:
conda create –name myenv
Note

Replace myenv with the environment name.

When conda asks you to proceed, type y:

proceed ([y]/n)?
This creates the myenv environment in /envs/. No packages will be installed in this environment.

To create an environment with a specific version of Python:

conda create -n myenv python=3.6
To create an environment with a specific package:

conda create -n myenv scipy
OR:

conda create -n myenv python
conda install -n myenv scipy
To create an environment with a specific version of a package:

conda create -n myenv scipy=0.15.0
OR:

conda create -n myenv python
conda install -n myenv scipy=0.15.0
To create an environment with a specific version of Python and multiple packages:

conda create -n myenv python=3.6 scipy=0.15.0 astroid babel
Tip

Install all the programs that you want in this environment at the same time. Installing 1 program at a time can lead to dependency conflicts.

To automatically install pip or another program every time a new environment is created, add the default programs to the create_default_packages section of your .condarc configuration file. The default packages are installed every time you create a new environment. If you do not want the default packages installed in a particular environment, use the –no-default-packages flag:

conda create –no-default-packages -n myenv python
Tip

You can add much more to the conda create command. For details, run conda create –help.

Creating an environment from an environment.yml file
Use the terminal or an Anaconda Prompt for the following steps:

Create the environment from the environment.yml file:

conda env create -f environment.yml
The first line of the yml file sets the new environment’s name. For details see Creating an environment file manually.

Activate the new environment: conda activate myenv

Verify that the new environment was installed correctly:

conda env list
You can also use conda info –envs.sds

Important Links:
Link- How to setup Python in Visual Studio Code:

Link- How to schedule the python Script in Windows Scheduler:

Link- How To Convert Python File To .exe File

Link- How to create BAT file to run the python program:

Link- How to run multiple python program from single Bat file:

Link- How to Create Virtual Environment in the Anaconda:

Link- How to fix ‘python’ is not recognized as an internal or external command:

Link- How to Select Python Interpreter in Visual Studio Code

Link- How to Enable Python run Cell in VSCode

Link- How to clear vscode terminal messages

Link: How to setup python in pycharm

Link: How to fix Python is not recognized as an internal or external command in Pycharm

Link: Writing SQL using Pandas in Excel Sheet Data

Link- How to Select Python Interpreter in Pycharm

Link- How to run Python Program From Command Prompt

Link- How to install and run Jupyter Notebook in your machine

#pythonworld

Source: https://www.youtube.com/watch?v=iUy6BYVWEbA

Leave a Reply

Your email address will not be published. Required fields are marked *