ArcGIS Pro & cloning Python environments; common issues and resolutions

February 24, 2020 Tom Thompson

With the release of ArcGIS Pro 2.2, any modification to the Python environment used by ArcGIS Pro requires that the default environment be cloned, as that environment is read-only and cannot be modified. When cloning the default environment within the Python Package Manager inside of ArcGIS Pro you may experience problems. This blog covers those most common problems and suggests potential workarounds to those problems. Let’s dive in.

Most issues related to creating clones of the ArcGIS Pro Python environment are related to permissions. Behind the scenes, ArcGIS Pro uses Conda. Conda, a Python package management program, is widely used and is the most popular package manager. Often, the conda installation which is leveraged to manage your environments and packages does not have permissions to download modules from the conda package repository or it does not have permissions to install those modules into your user profile. If you launch ArcGIS Pro as an administrator and try again most times these issues are resolved. If your problems continue, please carry on reading.

Note: ArcGIS Pro comes with its own conda installation. You do not need to download and install your own version of Conda or Anaconda.

If your cloning continues to fail within ArcGIS Pro’s Python package manager, no problem. We can leverage conda directly using the Python Command Prompt. This can be found in Start > ArcGIS > Python Command Prompt (Make sure to run this as administrator as well). To build a clone using conda directly, we use the command:

conda create --clone="C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3" -p "C:\Your\Output\Directory" 

This command matches very closely to what ArcGIS Pro uses when cloning from the Python Package Manager but often will either resolve the problem or will provide us with more detailed information as to why it failed. If it succeeds, ensure you’ve activated the environment by using the conda activate command:

conda activate "C:\Your\Output\Directory” 

Then proceed to ArcGIS Pro Python Package Manager and set it as your default environment using the ‘Add’ button and browse to where you generated this new clone. Lastly, restart ArcGIS Pro and you’re all set! If the cloning failed, carry on reading.

Python Command Prompt showing a manual clone in progress, downloading modules

Sometimes, network security or firewalls are to blame for failed clones. The conda package repository can be blocked and your machine will be unable to access that repository. When this is true, the cloning will also fail; you may see errors like ‘HTTP 000 CONNECTION FAILED’. We can test to confirm if your machine can access the repository directly by leveraging CURL, a command line library which mimics network protocols. To do this, launch your windows command prompt by searching for ‘CMD’. Once launched, type the command:

curl -Iv https://conda.anaconda.org

A successful connection would complete an SSL/TLS handshake and provide session information, such as a cookie. An unsuccessful connection is more obvious and would say ‘Could not resolve host: conda.anaconda.org’ and would close the connection. If the connection is unsuccessful, you’ll need to have https://conda.anaconda.org allowed through your network, which may involve contacting your IT or helpdesk teams.

CURL command used in the Windows 10 Command Prompt with a successful request

Lastly, for advanced users, the ArcGIS Pro conda install comes with a configuration file (named .condarc) which can be used to leverage proxies or include additional configuration settings which conda can leverage. This file is found in C:\Program Files\ArcGIS\Pro\bin\Python. The configuration settings in the .condarc file may resolve issues related to network security or cloning. This includes options for disabling or enabling SSL verification, adding proxy servers and adding custom channels for accessing your own modules. Sometimes, as a last resort, we can implement some configuration settings in this file to allow us to successfully create clones of our conda environment. Often this will involve working with your IT or Helpdesk team as well.

Example of a .condarc file with custom configuration settings

These are the most common troubleshooting techniques you can leverage to resolve cloning issues in conda and ArcGIS Pro. If you’re still experiencing issues after going through some or all these suggestions, please contact your distributor’s technical support team for further assistance. If it has resolved your issues, happy coding!

About the Author

Tom Thompson

Tom Thompson is a Developer Support Analyst with Esri Canada’s Developer Support Team. He has a Bachelor of Science in Environmental Geoscience and Geomatics from the University of Guelph and a Graduate Certificate as a GIS Applications Specialist from Fleming College. Tom’s passion in GIS stems from his childhood spent exploring Ontario’s cottage country and his interest in technology. He hopes that his work in GIS will help to manage and care for the environment so that future generations can enjoy it as he does. In Tom’s day-to-day role, he provides support to clients who have implemented automation or customization of Esri software and applications.

More Content by Tom Thompson
Previous Video
Using Deep Learning with Imagery in ArcGIS
Using Deep Learning with Imagery in ArcGIS

Learn how to implement Deep Learning workflows in ArcGIS to perform imagery analysis. We will explore Deep ...

Next Article
Troubleshooting ArcGIS Pro like an Esri Canada Support Analyst: Part 2 (Named User Licensing)
Troubleshooting ArcGIS Pro like an Esri Canada Support Analyst: Part 2 (Named User Licensing)

Read this blog post to learn how to troubleshoot Named User Licensing issues in ArcGIS Pro

Have a comment or question?

Contact Us