TensorFlow install error, Windows LongPath support not enabled

Viewed 9406

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.

3 Answers

I solved the problem though, I'm a bit unsure how, so I will post my process so that way if anyone else runs into this same problem, they can not run into such a frustrating issue.

  1. I uninstalled python and Pip.
  2. Instead of downloading python from the Microsoft Store, I downloaded it from the python website - Be sure to add it to your path as you when installing it. I downloaded Python 3.9.8
  3. Do not update pip
  4. Pip install tensorflow

I suspect the problem was either with updating pip, or with installing python via the Microsoft store, not via the installer on the website. But regardless is works now.

I recently encountered this error. The changing the enablelongpaths to 1 in the registry resolved it. I couldn't get gpedit changes to take hold.

Related