I have tried installing tensorflow in the terminal as well as Pycharm and Jupiter Notebook. I am running the terminal as administrator (Windows). I have updated to the latest version of pip. This is the error message that comes up:
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: 'C:\Users\User\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
I have gone to the URL suggested and am at a complete loss of how to fix this. Any advice would be appreciated.
CodePudding user response:
The problem is that the file path you mention is longer than the maximum path length MAX_PATH
, defined as 260 characters.
To fix this, open PowerShell as an administrator and run the following command:
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force