PROBLEM

Unable to clone Python environment in ArcGIS Pro. WinError 206 The filename or extension is too long

Last Published: December 2, 2024

Description

In ArcGIS Pro, attempts to clone a Python environment fail and the following error is returned:

Error: 
InvalidArchiveError("Error with archive C:\\Users\\<username>\\AppData\\Local\\ESRI\\conda\\pkgs\\tensorflow-base-2.7.0-py39_cuda11.1_cudnn8.1_6.tar.bz2. You probably need to delete and re-download or re-create this file. Message was:\n\nfailed with error: [WinError 206] The filename or extension is too long: 'C:\\\\Users\\\\<username>\\\\AppData\\\\Local\\\\ESRI\\\\conda\\\\pkgs\\\\tensorflow-base-2.7.0-py39_cuda11.1_cudnn8.1_6\\\\Lib\\\\site-packages\\\\tensorflow\\\\include\\\\external\\\\cudnn_frontend_archive\\\\_virtual_includes\\\\cudnn_frontend\\\\third_party\\\\cudnn_frontend\\\\include\\\\contrib\\\\nlohmann\\\\json'")
The image of the returned error message

Cause

  • The path length or filename for the directory of the new Python environment clone is too long.
  • The existing Conda package is corrupted.

Solution or Workaround

Depending on the cause, the workarounds provided are applicable.

Adjust the length of the filename

Ensure the filename and path do not exceed the maximum Windows allowable length of 260 characters. Refer to Microsoft Learn: Maximum Path Length Limitation for more information.

Clean the Conda files and packages and enable the long path property in the Windows Registry

Warning: 
The instructions below include making changes to essential parts of the operating system. Esri recommends performing a backup of the operating system and files, including the registry, before proceeding. 

Esri cannot guarantee results from incorrect modifications while following these instructions. Exercise caution. Consult a qualified computer systems professional if necessary. 
  1. In the Windows search box on the taskbar, search for and right-click Python Command Prompt, then select Run as administrator.
  2. Enter the following command to remove the index cache, lock files, unused cache packages, tarballs, and logfiles.
conda clean –-all
  1. Type y to confirm subsequent prompts.
The image of the Python Command Prompt window with the conda clean all command.
  1. In the Windows search box on the taskbar, search for and click Run.
  2. Type regedit and click OK to open the Registry Editor window.
The image of the Run window to open regedit.
  1. In the Registry Editor window, navigate to Computer > HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Control > FileSystem.
The image of the Registry Editor window to navigate to the FileSystem folder
  1. Double-click LongPathsEnabled to set the Value data parameter from 0 to 1. Click OK.
The image of the value data of LongPathsEnabled being set to 1
  1. Restart the machine before launching ArcGIS Pro to clone a new Python environment through Package Manager in ArcGIS Pro or Python Command Prompt.
Note:
Alternatively, perform a clean uninstall and reinstall of ArcGIS Pro before cloning a new Python environment.

Article ID: 000032633

Software:
  • ArcGIS Pro 3 1
  • ArcGIS Pro 3 3
  • ArcGIS Pro 3 2
  • ArcGIS Pro 3 4

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