Obscure error message when file name is too long
See original GitHub issueEnvironment
- 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:
- Created 4 years ago
- Comments:7 (5 by maintainers)
Top GitHub Comments
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 defaultFileNotFoundError
; to provide a clearer message we’d need to catch that.)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.