I find I need to create virtual environments quickly for different projects. With this script, you just need to enter the virtual environment name and Python version (if needed). It assumes you already have your Anaconda or Miniconda installed and running properly.
-
Save the
batch_conda_create.bat
file to whatever directory you wish to execute it from. Right-click to edit with your favoured text-editor, e.g. Notepad. Change theroot
value to where your Anaconda or Miniconda is installed in. (I prefer to hard code this in the script as my Anaconda installation directory does not change often, if at all.) -
Save your changes and when ready to execute the script, double left-click it. Enter the name of your virtual environment at the prompt. (Keep it short and with no spaces.)
-
At the next prompt, enter the Python version number. Press Enter without entering a version number to install the latest version.
-
The virtual environment should be created within 5-10 seconds.
-
Activate the virtual environment from your favoured IDE or terminal.