-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Cannot install packages with long filenames #7203
Comments
Closing, please fill in the details asked for in the issue template. EDIT: I (@kalefranz) am overtaking this comment to pull out action items discussed below.
|
Not following. Seems like all of the info was filled out, no? Maybe a more specific request would help. |
One part in particular that’s missing is |
This report ( conda-forge/nodejs-feedstock#33 ) does supply |
I reported conda-forge/nodejs-feedstock#33; the problem arose while trying to install nodejs 9.11.0-0 from conda-forge using conda 4.5.1 and python 3.6.5 on Win7. Output of conda info follows:
|
Can we get this reopened? All requested info has been provided. |
I’m ok re-opening. However fixing this is a non-trivial project that will have to be stacked against other priorities. In the meantime, users encountering this problem can add something like
to their condarc file. |
Sure but I should note that fixing it requires asking the end user to set a registery key and that's going to be a lot of work. Also allowing conda to install to paths requiring >260 characters will break a whole load of software with inbuilt assumptions of a maximum requirement of 260 characters, some of which testing would catch allowing us to fix but some of it not. These unfixed ones can in turn lead to stack buffer overflows so it's not something that can be just done and forgotten about (any time a function assumes that the calling function had already checked the 260 limit which would no longer always be the case for example). Regardless, a registery key with this option could be implemented into constructor and PRs to do that would be welcomed. |
I could also add the registry key to ‘conda init’.
…Sent from my iPhone
On May 20, 2018, at 3:08 PM, Ray Donnelly ***@***.***> wrote:
Sure but I should not that fixing it requires asking the end user to set a registery key and that's going to be a lot of work.
Also allowing conda to install to paths requiring >260 characters will break a whole load of software with inbuilt assumptions of a maximum requirement of 260 characters, some of which testing would catch allowing us to fix but some of it not.
These unfixed ones can in turn lead to stack buffer overflows so it's not something that can be just done and forgotten about.
Regardless, a registery key with this option could be implemented into constructor and PRs to do that would be welcomed.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I think it needs to be done at the |
Thanks all. FWIW 3 issues were filed against the Guessing by registry key change, you are referring to something like this, correct? |
Indeed. And as you can see it's win 10 only so NSIS UI would be to be done for that unless But let's not rush into another And I also believe this is being or had been fixed in newer node releases and we're mostly editing for an LTS release to fix it anyway? |
Are there solutions for older versions of Windows? Not sure I follow the Recent reports include Node.js 9.11.0, which was released nearly two months ago. |
No solutions I'm aware of no. We tried ages ago to use UNC paths in conda but Windows file locking broke badly. The |
My understanding of this being fixed in node is that I believe node and npm themselves no longer have a problem with extremely deep paths on Windows, and continue to routinely make paths greater than 260 characters and that won't change. There was an improvement in path length when npm started deduping packages by default, resulting in a slightly reduced path length, but then shortly after it also increased its dependencies essentially negating that improvement. That was always a partial fix that would only work for some packages. It's AOK for me if this starts out as a documentation I can point to, even if it's a manual fix requiring admin permissions for some folks. Of course, true support for long paths would be ideal, but a clear "You need to do this..." link would be a great start. Double bonus if it could be in the error message from conda itself when install fails due to long path errors. |
For binary file prefix replacement, we have to be careful that we're not trying to shove in a path that's longer than the binary placeholder. It's been a while since I looked at this logic, so I created #7324 as a reminder. Prefix replacement in text files isn't as much of an issue. |
Host: Win10
to my condarc file
Not sure where to go from here. |
Hacked a way through...
May this help someone else too 👍 ! |
After that configuration change, try
|
Seems to "work" though I have no idea what I just did!
|
You successfully created an environment located at
in the Anaconda Prompt. |
I fix it to enable Win32 long paths. As windows10 pro, you can open Local Group Policy Editor, and open item Computer Configuration -> Administrative Templates -> System -> Filesystem -> Enable Win32 long paths and click it to make it enable. But I have got the information it's just support windows10, I don't know it will or will not work in Windows8 or old. |
I recently ran into this issue, which is much worse in default configurations of most CI systems because they want to work out of the checkout directory, which can already have a fairly long path. The error message wasn't particularly helpful ; it just gave me a
during an environment build (at the "Executing transaction" stage). Fortunately, I've seen this kinda thing before, but if possible it'd be great if Conda could detect this particular problem and give a better error message, e.g. "The system has hit the maximum file-path length for this version of Windows". This would help people who are not aware of these limits on Windows as they have a longer and more fragile path to understanding. |
Windows has a maximum path length that it can reason about. A recent refactoring of a crypto package pushed us just over this limit, but packages with long descriptions could too. This just pushes the problem back a bit. If we run into this again (will only hit windows), we may need to move the package install dir out from the checkout working dir, which would make for management issues but would otherwise pretty solidly solve the issue. See conda/conda#7203 for more info.
I can confirm that setting LongPathsEnabled from 0 to 1 solved this issue on Windows 10 64bits |
Hi there, thank you for your contribution to Conda! This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs. If you would like this issue to remain open please:
NOTE: If this issue was closed prematurely, please leave a comment and we will gladly reopen the issue. In case this issue was originally about a project that is covered by the Anaconda issue tracker (e.g. Anaconda, Miniconda, packages built by Anaconda, Inc. like Anaconda Navigator etc), please reopen the issue there again. Thanks! |
IIRC Node changed behavior to avoid this issue. That said, we still see this issue crop up periodically. |
There are still reports of the max path length limit being hit when installing tensorflow builds in this stale issue here: #10767 This doesn't seem to be getting fixed from the tensorflow side as they still nest files deep into Setting the registry key to enable long paths enables existing tensorflow conda packages to be installed and environments to clone; however, building the tensorflow package I still hit a |
Execute both as admin: The second command specifically solves the issue related to building with pip. |
This is how we tell our windows users to setup their systems to install tensorflow builds when built with long path names enabled. It works but some users can't get their admins to enable long paths which makes the package uninstallable. Right now we are documenting this as a known issue for deep learning using conda with tensorflow. For our daily Windows CI test machine we set the following at the beginning of machine setup in order to install deep learning packages with long path names:
|
Since I'm gathering from this that most people are solving this issue on the package side, is there a de facto path length limit that packages are expected to adhere to to avoid seeing this problem, at least for most users? |
@asmeurer For most users, the filename in the package cache will be the limiting step, as that includes the full package name, and package names with their suffixes and hashes tend to be longer than the environment names themselves. Here's a worked example showing how long the username of a Windows user could be for a max_path = 260
user_base = "C:\\Users\\"
pkgs_subdir = "\\AppData\\Local\\conda\\conda\\pkgs"
package_name = "tensorflow-base-2.7.0-py39_cuda11.1_cudnn8.1_7"
max_package_path = r"/Lib/site-packages/tensorflow/include/external/cudnn_frontend_archive/_virtual_includes/cudnn_frontend/third_party/cudnn_frontend/include/cudnn_frontend_EngineConfigGenerator.h"
# what's the maximum length of a username allowed below MAX_PATH for this case?
max_path - sum([len(s) for s in [user_base, pkgs_subdir, package_name, max_package_path]]) In this example, the maximum username length would be -2, so invalid paths will be written and the installation will fail unless long paths are enabled. For a package with a shorter package name and shorter lengths, this typically isn't an issue. As a general guideline, I'd say something like 130 characters for the package path should be OK. In the failure above the max package path length is 176 characters, and in the nodejs issue originally posted it is 190 characters. |
Thanks for the info @scdub. As it were, I'm not really asking as a packager, but as someone trying to figure out how long of a prefix path I can get away with. That's why I asked if there's a de facto standard. But knowing that almost all installations use this particular directory structure is very helpful. |
I'm submitting a...
Current Behavior
Cannot install nodejs on Windows due to long paths.
nodejs produces extremely deeply nested
node_modules/pkg/node_modules/pkg/...
, making it pretty easy to readily exceeding the Windows max path limit. nodejs itself doesn't seem have any issues with these long paths due to using modern Windows APIs, but Python seems to have issues.This is related to #2452, but there seem to be other places (install) where UNC path prefixes or similar patches may be needed.
Reported on the nodejs conda package: conda-forge/nodejs-feedstock#12
Steps to Reproduce
On Windows:
Expected Behavior
package should install without errors
The text was updated successfully, but these errors were encountered: