English

How To: Clone a Python environment with the Python Command Prompt

Summary

ArcGIS Pro provides a user-friendly interface to manage Python environments with the Python Package Manager, a tool that can create, clone, activate and remove Python environments. However in some instances, the Manage Environment dialog box does not allow cloning or creating a new environment.

Procedure

Alternatively, Python environments can be cloned using the Python Command Prompt by following the steps below:

  1. Run the Python Command Prompt as an administrator.
    1. Click the Start icon.
    2. Navigate to the ArcGIS folder.
    3. Click Python Command Prompt.
Note:
An alternative to run the command prompt as an administrator is to right-click Python Command Prompt > More > Open file location. Right-click Python Command Prompt and click Run as administrator.
  1. Search for all the available Python environments by entering the following command:
conda env list
Screenshot of the Python Command Prompt with the list command highlighted.
  1. Identify the name of the Python environment to clone. In this example, the environment to be cloned is arcgispro-py3.
Screenshot of the Python Command Prompt with the environment highlighted.
  1. Clone the environment by entering the following command:
conda create --clone <environment to clone>  --name <new enviroment name>
Note:
For this example, the command is: conda create --clone arcgispro-py3 --name arcgispro-py3_clone
Screenshot of Python Command Prompt with the clone command highlighted
 Alternatively, to clone the environment to a specific directory path, enter the command as:
conda create --clone <environment to clone>  --name <path><new enviroment name>
Note:
For this example, the command is: conda create --clone arcgispro-py3 --name C:\Testing\arcgispro-py3_clone

Related Information