PROBLEM

Unable to use Python in ArcGIS Pro when using a cloned environment

Last Published: October 19, 2023

Description

When attempting to use Python in ArcGIS Pro using a cloned environment, the initialization process fails and returns the following error messages in the Python window and Python notebook:

The Python window

Error:
Failed to Initialize Python Interpreter
The "Failed to Initialize Python Interpreter" error message.

The Python notebook

Error:
Failed to create notebook server
The "Failed to create notebook server" error message.

In addition, running the Python Command Prompt returns the following error message:

Error:
CMD does not support UNC paths as current directories.
The "CMD does not support UNC paths as current directories." error message in Python Command Prompt.

Cause

This issue occurs when the cloned Python environment is located on a network location with Universal Naming Convention (UNC) paths. By design, Python Package Manager is unable to read Python environments with UNC paths. The image below shows an example of a cloned Python environment located on a network location with UNC paths in the Environment Manager dialog box.

The Environment Manager dialog box.

Solution or Workaround

To solve this issue, follow the steps provided below to create a symbolic link to the directory of the cloned Python environment with a Universal Naming Convention (UNC) path and add the symbolic link in ArcGIS Pro.

  1. In the Windows search box on the taskbar, search for and right-click Windows Command Prompt, then select Run as administrator.
The Run as administrator option to run the Command Prompt.
  1. In the Administrator: Command Prompt window, run the following command to create a symbolic link between the local folder and the cloned Python environment file path.
mklink /D <local_folder_location>\<file_name> <network_folder_location>
Note: 
Enclose the folder name in double quotes (" ") if the folder name contains spaces. For example, "C/DESKTOP/ENV TEST 1".
The Administrator: Command Prompt window.
  1. Navigate to the symbolic link created in Step 2 and copy the file path.
The file path of the symbolic location created in Step 3.
  1. Open the project in ArcGIS Pro. At the top ribbon, click the Project tab.
The Project tab at the top ribbon in ArcGIS Pro.
  1. In the list of side tabs, click Package Manager.
The Package Manager tab.
  1. In the Package Manager window, click the Environment Manager button.
The Environment Manager button in the Package Manager window.
  1. In the Environment Manager dialog box, click the Add existing environment button.
The Add existing environment button in the Environment Manager dialog box.
  1. In the Browse Environments dialog box, paste the file path copied in Step 3 in the Name box and click OK.
The Browse Environment dialog box.
  1. In the Environment Manager dialog box, hover over and double-click the newly added Python environment to activate the environment. Click OK.
The Environment Manager dialog box with Python environments (cloned and default).

Article ID: 000027347

Software:
  • ArcGIS Pro 3 1
  • ArcGIS Pro 3 0

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options