Migrate a Conda Environment

Do the following steps to export a Conda environment.

  1. Open Anaconda Prompt and activate the environment you want to migrate.
    conda activate <name_of_environment>
  2. Export the active environment.
    conda env export > environment.yml

Import this environment file into a new machine.

  1. Open up Anaconda Prompt and go to that directory which has environment.yml.
  2. Create the environment by running:
    conda env create -f environment.yml

Reference

https://medium.com/swlh/setting-up-a-conda-environment-in-less-than-5-minutes-e64d8fc338e4

Creating a Virtual Environment in Jupyter Notebook for Windows

You need to have Anaconda installed.

  1. Open Anaconda Prompt and create a new environment with the following command.
    conda create --name NewEnv python=3.7.0
  2. Activate the new environment.
    conda activate NewEnv
  3. Install ipykernel in the new environment.
    (NewEnv) $ pip install ipykernel
  4. Install the new environment to Jupyter Notebook.
    python -m ipykernel install --user --name=NewEnv
  5. Check your new environment in Jupyter Notebook.

Reference

https://medium.com/@utkarsh.ankit09/a-simple-guide-for-creating-virtual-environment-in-jupyter-notebook-python-for-windows-1649041aaae1