scancode-toolkit icon indicating copy to clipboard operation
scancode-toolkit copied to clipboard

pip installation fails on Windows 11 with Python 3.11

Open michaeldorner opened this issue 2 years ago • 5 comments

Description

When installing scancode-toolkit via pip (Python 3.11 on Windows 11), the installations fails with the error code

 error: coud not create 'build\bdist.win-amd64\wheel\.\licensedcode\data\rules\epl-1.0_or_lgpl-2.1-plus_or_agpl-2.0-plus_or_agpl-3.0-plus_or_bsd-new_or_mit_1.RULE': No such file or directory

A wild guess: Maybe it is Python 3.11?

How To Reproduce

Tell us how to reproduce the issue.

 python3.11 -m pip install scancode-toolkit

System configuration

For bug reports, it really helps us to know:

  • What OS are you running on? (Windows/MacOS/Linux) Windows 11, Python 3.11
  • What version of scancode-toolkit was used to generate the scan file? 31.2.4
  • What installation method was used to install/run scancode? (pip/source download/other) pip

Thanks for looking into this issue!

michaeldorner avatar Apr 02 '23 15:04 michaeldorner

error: could not create 'build\bdist.win-amd64\wheel\.\licensedcode\data\rules\epl-2.0_or_apache-2.0_or_gpl-2.0_with_classpath-exception-2.0_or_gpl-2.0_with_openjdk-exception_1.RULE': No such file or directory

python3.11.3

shricodev avatar Apr 17 '23 03:04 shricodev

Hi, we have the same issue on Windows 11 but not on Linux with 31.2.6. Is this fixed in 32.x? Anyway to backport the fix to 31.x?

jloehel avatar May 08 '24 16:05 jloehel

@michaeldorner sorry for missing to see this issue! I think the problem is one of maximum path length on Windows because of very long filename:

>>> len('epl-1.0_or_lgpl-2.1-plus_or_agpl-2.0-plus_or_agpl-3.0-plus_or_bsd-new_or_mit_1.RULE')
83
>>> len('epl-2.0_or_apache-2.0_or_gpl-2.0_with_classpath-exception-2.0_or_gpl-2.0_with_openjdk-exception_1.RULE')
102

pombredanne avatar May 08 '24 17:05 pombredanne

@jloehel I am not sure there is a fix in 32.... but what I am sure is that there are massive changes between 31.2.6 and 32.1.0: https://github.com/nexB/scancode-toolkit/compare/v31.2.6...v32.1.0

  • 1114 commits
  • 75,679 changed files with 1,285,110 additions and 374,814 deletions

It may be possible to backport a fix that may consist to shorten these file names, but that's not a happy thing to do!

Alternatively try to use a directory that is short and close to or at the root of a drive to gets short paths.

pombredanne avatar May 08 '24 17:05 pombredanne

@pombredanne Thanks for the response. Do you know why I can't find the mentioned file in v31.2.4 or v31.2.6:

# This file is there
❯ find . -iname epl-2.0_or_apache-2.0_or_gpl-2.0_with_classpath-exception-2.0_or_gpl-2.0_with_openjdk-exception_1.RULE
./src/licensedcode/data/rules/epl-2.0_or_apache-2.0_or_gpl-2.0_with_classpath-exception-2.0_or_gpl-2.0_with_openjdk-exception_1.RULE
# But this file is not there
❯ find . -iname epl-1.0_or_lgpl-2.1-plus_or_agpl-2.0-plus_or_agpl-3.0-plus_or_bsd-new_or_mit_1.RULE

My fault. Sorry. ^^ For us its:

epl-1.0_or_lgpl-2.1-plus_or_gpl-2.0-plus_or_agpl-3.0-plus_or_apache-2.0_or_bsd-new_or_mit_1.RULE

This one exists. Is it possible to just rename the file or is the naming important? All necessary information should be also saved in the file, right?

edit: Making the path shorter fixes the issue.

jloehel avatar May 08 '24 17:05 jloehel