Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accurate error thrown if hitting MAX_PATH on Windows #10142

Closed
1 task done
jamesbraza opened this issue Jul 7, 2021 · 1 comment
Closed
1 task done

Accurate error thrown if hitting MAX_PATH on Windows #10142

jamesbraza opened this issue Jul 7, 2021 · 1 comment
Labels
type: bug A confirmed bug or unintended behavior

Comments

@jamesbraza
Copy link

Description

I spent a few hours hours battling an installation yesterday, getting this error:

ERROR: Could not build wheels for foo-pkg which use PEP 517 and cannot be installed directly

I was reading through PEP 517, searching all around the internet for a fix. I tried many potential fixes, and eventually came across this Stack Overflow post, which made me realize I was hitting the Windows MAX_PATH limitation.

This error (hitting Windows MAX_PATH) has basically nothing to do with the error that was being printed to console.

The request: have pip check for Windows MAX_PATH and inform the user that's the problem, instead of throwing an error that isn't related.

Expected behavior

A search through pip's issues shows that other users have hit this problem: https://github.com/pypa/pip/issues?q=is%3Aissue+MAX_PATH

It seems like, every time someone runs into this issue, that someone else has to inform the poor soul of this esoteric Windows limitation.

My expected behavior is:

  • An error: "pip installation failed due to Windows MAX_PATH limitation"
  • Or a warning: "Path exceeded 260 chars and Windows extended paths not enabled"

pip version

21.1.3

Python version

3.8.5

OS

Windows 10 Pro Version 2004

How to Reproduce

  1. Use Windows OS
  2. Try to do a pip install within a bunch of nested directories
  3. Have a package with a long name

Also, my package was installed using setuptools_scm==6.0.1

Output

I anonymized this a bit, since it's from a private package within a company.  I kept the character length the same for all the names.

Building wheels for collected packages: aaaaaaaaaa-bbbb-cccccc-ddddddd-eeeeeeeeee
  Building wheel for aaaaaaaaaa-bbbb-cccccc-ddddddd-eeeeeeeeee (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\company_\code\repo-name\venv\scripts\python.exe' 'c:\company_\code\repo-name\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\AAAAAA~1\AppData\Local\Temp\tmpwrln9m5v'
       cwd: C:\Users\useraccount_____\AppData\Local\Temp\pip-install-bm1rwh1t\aaaaaaaaaa-bbbb-cccccc-ddddddd-eeeeeeeeee_a1b1b11edebe11b1a1bc1d111d11f111
  Complete output (35 lines):
  running bdist_wheel
  running build
  running build_py
  package init file 'aaaaaaaaaa\__init__.py' not found (or not a regular file)
  package init file 'aaaaaaaaaa\bbbb_lh\__init__.py' not found (or not a regular file)
  creating build
  creating build\lib
  creating build\lib\aaaaaaaaaa
  creating build\lib\aaaaaaaaaa\bbbb_lh
  creating build\lib\aaaaaaaaaa\bbbb_lh\eeeeeeeeee
  copying aaaaaaaaaa\bbbb_lh\eeeeeeeeee\media_exchange.py -> build\lib\aaaaaaaaaa\bbbb_lh\eeeeeeeeee
  copying aaaaaaaaaa\bbbb_lh\eeeeeeeeee\__init__.py -> build\lib\aaaaaaaaaa\bbbb_lh\eeeeeeeeee
  running egg_info
  writing aaaaaaaaaa_bbbb_cccccc_ddddddd_eeeeeeeeee.egg-info\PKG-INFO
  writing dependency_links to aaaaaaaaaa_bbbb_cccccc_ddddddd_eeeeeeeeee.egg-info\dependency_links.txt
  writing requirements to aaaaaaaaaa_bbbb_cccccc_ddddddd_eeeeeeeeee.egg-info\requires.txt
  writing top-level names to aaaaaaaaaa_bbbb_cccccc_ddddddd_eeeeeeeeee.egg-info\top_level.txt
  reading manifest file 'aaaaaaaaaa_bbbb_cccccc_ddddddd_eeeeeeeeee.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file 'aaaaaaaaaa_bbbb_cccccc_ddddddd_eeeeeeeeee.egg-info\SOURCES.txt'
  copying aaaaaaaaaa\bbbb_lh\py.typed -> build\lib\aaaaaaaaaa\bbbb_lh
  installing to build\bdist.win-amd64\wheel
  running install
  running install_lib
  creating build\bdist.win-amd64
  creating build\bdist.win-amd64\wheel
  creating build\bdist.win-amd64\wheel\aaaaaaaaaa
  creating build\bdist.win-amd64\wheel\aaaaaaaaaa\bbbb_lh
  creating build\bdist.win-amd64\wheel\aaaaaaaaaa\bbbb_lh\eeeeeeeeee
  copying build\lib\aaaaaaaaaa\bbbb_lh\eeeeeeeeee\media_exchange.py -> build\bdist.win-amd64\wheel\.\aaaaaaaaaa\bbbb_lh\eeeeeeeeee
  copying build\lib\aaaaaaaaaa\bbbb_lh\eeeeeeeeee\__init__.py -> build\bdist.win-amd64\wheel\.\aaaaaaaaaa\bbbb_lh\eeeeeeeeee
  copying build\lib\aaaaaaaaaa\bbbb_lh\py.typed -> build\bdist.win-amd64\wheel\.\aaaaaaaaaa\bbbb_lh
  running install_egg_info
  Copying aaaaaaaaaa_bbbb_cccccc_ddddddd_eeeeeeeeee.egg-info to build\bdist.win-amd64\wheel\.\aaaaaaaaaa_bbbb_cccccc_ddddddd_eeeeeeeeee-0.1.dev111+g11111ca-py3.8.egg-info
  error: [Errno 2] No such file or directory: 'build\\bdist.win-amd64\\wheel\\.\\aaaaaaaaaa_bbbb_cccccc_ddddddd_eeeeeeeeee-0.1.dev111+g11111ca-py3.8.egg-info\\dependency_links.txt'
  ----------------------------------------
  ERROR: Failed building wheel for aaaaaaaaaa-bbbb-cccccc-ddddddd-eeeeeeeeee
Failed to build aaaaaaaaaa-bbbb-cccccc-ddddddd-eeeeeeeeee
ERROR: Could not build wheels for aaaaaaaaaa-bbbb-cccccc-ddddddd-eeeeeeeeee which use PEP 517 and cannot be installed directly

Code of Conduct

@jamesbraza jamesbraza added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Jul 7, 2021
@uranusjr
Copy link
Member

uranusjr commented Jul 7, 2021

See #10045

@uranusjr uranusjr closed this as completed Jul 7, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 25, 2021
@pradyunsg pradyunsg removed the S: needs triage Issues/PRs that need to be triaged label Mar 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants