Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TensorFlow install error, Windows LongPath support not enabled

I'm trying to install TensorFlow but I keep getting a longpath error , I have Python 3.9 installed and pip 21.3.1. Whenever I run pip install tensorflow I receive the following error:

ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: 'C:\Users\obrie\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\tensorflow\include\external\com_github_grpc_grpc\src\core\ext\filters\client_channel\lb_policy\grpclb\client_load_reporting_filter.h' HINT: This error might have occurred since this system does not have Windows Long Path support enabled. You can find information on how to enable this at https://pip.pypa.io/warnings/enable-long-paths

This seems to clearly be an error caused by the fact that LongPathsEnabled was set to false by default. I've got into my registry editor, gone to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem and changed LongPathsEnabled to a value of 1.

LongPathsEnabled set to 1

I've restarted my computer, but still get the longpaths error. Please help me understand what I am missing.

like image 263
Richard O'Brien Avatar asked Jun 07 '26 00:06

Richard O'Brien


1 Answers

This fixed the problem for me!! Here are the steps to enable long path support:

  1. Open the Start menu and type "gpedit.msc" in the search bar. Press Enter to open the Local Group Policy Editor.
  2. In the editor, navigate to "Computer Configuration" > "Administrative Templates" > "System" > "Filesystem".
  3. Double-click the "Enable Win32 long paths" policy and set it to "Enabled".
  4. Click "OK" to save the policy changes.
  5. Restart your computer to apply the changes.
like image 145
Meric Ozcan Avatar answered Jun 08 '26 12:06

Meric Ozcan