question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Obscure error message when file name is too long

See original GitHub issue

Environment

  • pip version: 19.3.1
  • Python version: 3.7.5
  • OS: Windows 10

Description Trying to install tensorflow-gpu (specifically tensorboard here), I got this error message:

ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: ‘C:\Users\myuser\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorboard\_vendor\tensorflow_serving\sources\storage_path\__pycache__\file_system_storage_path_source_pb2.cpython-37.pyc’

Expected behavior Clearer error message:

ERROR: Could not install packages due to an IOError: [Errno 36] File name too long

Possibly with a hint towards the solution (suggested in SO) of changing the registry to allow long paths, which resolved the issue for me, or any other recommended way of resolving the issue. However, simply adding a dedicated exception name will make googling and answering better - in the linked SO question, it seems like the answer is relevant to my error but not to the original question.

How to Reproduce

I don’t know how to reproduce it on an arbitrary machine. All I did was getting the package, not in a virtualenv.

Output

C:\Users\myuser>python3 -m pip install tensorboard
Collecting tensorboard
  Using cached https://files.pythonhosted.org/packages/d3/9e/a48cd34dd7b672ffc227b566f7d16d63c62c58b542d54efa45848c395dd4/tensorboard-2.0.1-py3-none-any.whl
Requirement already satisfied: werkzeug>=0.11.15 in c:\users\myuser\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from tensorboard) (0.16.0)
Requirement already satisfied: wheel>=0.26; python_version >= "3" in c:\users\myuser\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from tensorboard) (0.33.6)
Requirement already satisfied: setuptools>=41.0.0 in c:\program files\windowsapps\pythonsoftwarefoundation.python.3.7_3.7.1520.0_x64__qbz5n2kfra8p0\lib\site-packages (from tensorboard) (41.2.0)
Requirement already satisfied: absl-py>=0.4 in c:\users\myuser\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from tensorboard) (0.8.1)
Requirement already satisfied: grpcio>=1.24.3 in c:\users\myuser\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from tensorboard) (1.25.0)
Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in c:\users\myuser\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from tensorboard) (0.4.1)
Requirement already satisfied: numpy>=1.12.0 in c:\users\myuser\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from tensorboard) (1.17.4)
Requirement already satisfied: google-auth<2,>=1.6.3 in c:\users\myuser\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from tensorboard) (1.7.1)
Requirement already satisfied: protobuf>=3.6.0 in c:\users\myuser\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from tensorboard) (3.10.0)
Requirement already satisfied: markdown>=2.6.8 in c:\users\myuser\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from tensorboard) (3.1.1)
Requirement already satisfied: six>=1.10.0 in c:\users\myuser\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from tensorboard) (1.12.0)
Requirement already satisfied: requests-oauthlib>=0.7.0 in c:\users\myuser\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard) (1.3.0)
Requirement already satisfied: pyasn1-modules>=0.2.1 in c:\users\myuser\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from google-auth<2,>=1.6.3->tensorboard) (0.2.7)
Requirement already satisfied: rsa<4.1,>=3.1.4 in c:\users\myuser\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from google-auth<2,>=1.6.3->tensorboard) (4.0)
Requirement already satisfied: cachetools<3.2,>=2.0.0 in c:\users\myuser\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from google-auth<2,>=1.6.3->tensorboard) (3.1.1)
Requirement already satisfied: requests>=2.0.0 in c:\users\myuser\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard) (2.22.0)
Requirement already satisfied: oauthlib>=3.0.0 in c:\users\myuser\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard) (3.1.0)
Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in c:\users\myuser\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from pyasn1-modules>=0.2.1->google-auth<2,>=1.6.3->tensorboard) (0.4.8)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:\users\myuser\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from requests>=2.0.0->requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\myuser\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from requests>=2.0.0->requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard) (2019.9.11)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in c:\users\myuser\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from requests>=2.0.0->requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard) (1.25.7)
Requirement already satisfied: idna<2.9,>=2.5 in c:\users\myuser\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from requests>=2.0.0->requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard) (2.8)
Installing collected packages: tensorboard
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: 'C:\\Users\\myuser\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python37\\site-packages\\tensorboard\\_vendor\\tensorflow_serving\\sources\\storage_path\\__pycache__\\file_system_storage_path_source_pb2.cpython-37.pyc'

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
uranusjrcommented, Nov 25, 2019

Would you mind adding -v so the error message shows where the exception was raised? It’d be much easier to pin point what section of the implementation we should work on to provide better information. (The “No such file or directory” error is from the default FileNotFoundError; to provide a clearer message we’d need to catch that.)

0reactions
no-response[bot]commented, Feb 20, 2020

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don’t have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Fix 'Filename Is Too Long' Issue In Windows
It's obvious who the offender is in this case. Find the file in Windows Explorer, or File Explorer as it's called in Windows...
Read more >
The filename or extension is too long? Here's a fix
The best way to fix The filename or extension is too long error is to rename the problematic directory or move the file...
Read more >
File name too long cannot copy - TechNet - Microsoft
If the file/path is too long then the user is unable to identify the particular file from the error message, so shortening is...
Read more >
SOLVED: The File Name Is Too Long
This error represents that the file name is either too long to open, delete, or edit considering the given file location or path...
Read more >
How to Fix 'File Name is Too Long' Error in Windows Explorer ...
In this video i will show you Fix for the “This file name is too long ” error message in Explorer.exe when try...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found