I recommend selecting that option and thereby removing the path length limit. It will potentially save you time in future on debugging an avoidable issue.
Here is an anecdote of how I came to know about it:
During the compilation of my program (C# code on a Windows machine), I started getting the following error:
error MSB3541: Files has invalid value "long\path\filename". The specified path,
file name, or both are too long. The fully qualified file name must be less than
260 characters, and the directory name must be less than 248 characters.
This error was not allowing me to build my project and the only apparent solution to this issue was to shorten my path/file names. Turns out that this bug is a built-in limitation in NTFS (Window's File System): Why does the 260 character path length limit exist in Windows?
After a couple of decades with the limitation built into the NTFS file system, it has finally been fixed (Unix based system did not have it) in Windows 10 (https://learn.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#maximum-path-length-limitation), but it is not enabled automatically, and needs registry (or group policy) settings to do this. The Python option allows you to disable it for Python libraries, saving you a lot of headache.
Do note that enabling this option will,
a) break compatibility of your programs on systems using older versions of Windows 10 and lower, when using long file/directory names and paths.
b) break programs on Windows 10 machines not having this option enabled, when using long file/directory names and paths.
Answer from khan on Stack OverflowSo I just installed python 3.10.5 and the setup gave me a option to disable path length limit and I'm clueless what that is because I have never did any coding before and this is my first time
HI, guys i need help. Am installing python 3.7.4 python in my windows 10. Then after installation, i got this disable path lenth limit. I don't know whether to disable or not.
I recommend selecting that option and thereby removing the path length limit. It will potentially save you time in future on debugging an avoidable issue.
Here is an anecdote of how I came to know about it:
During the compilation of my program (C# code on a Windows machine), I started getting the following error:
error MSB3541: Files has invalid value "long\path\filename". The specified path,
file name, or both are too long. The fully qualified file name must be less than
260 characters, and the directory name must be less than 248 characters.
This error was not allowing me to build my project and the only apparent solution to this issue was to shorten my path/file names. Turns out that this bug is a built-in limitation in NTFS (Window's File System): Why does the 260 character path length limit exist in Windows?
After a couple of decades with the limitation built into the NTFS file system, it has finally been fixed (Unix based system did not have it) in Windows 10 (https://learn.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#maximum-path-length-limitation), but it is not enabled automatically, and needs registry (or group policy) settings to do this. The Python option allows you to disable it for Python libraries, saving you a lot of headache.
Do note that enabling this option will,
a) break compatibility of your programs on systems using older versions of Windows 10 and lower, when using long file/directory names and paths.
b) break programs on Windows 10 machines not having this option enabled, when using long file/directory names and paths.
to answer both of your questions:
Should you disable this?
The quick answer is that it doesn't matter that much, since this only matters when working with paths longer than 260 characters, not something most people do.
What are the pros and cons of disabling the path length limit?
Pros
- you won't get an error when working with filepaths longer than 260 characters, so there's less worry about the path length
- it can make debugging easier
Cons
- disabling it has no negative technical side effects
- if you work in a team, it might introduce bugs where code works on your machine, but not on their machine. because you have the path-limit disabled, but they don't.
- disabling it can have negative human behaviour side effects. Enabling long paths could promote bad naming-behaviour in your team regarding pathnames and folderstructure. A limit forces people to shorten their paths.
E.g. I've worked in teams with paths like this, and allowing them longer names would have resulted in less readable filepaths:
c:/project_name/unity/files/assets/UI/UI_2.0/levelname/season2_levelname/release_season2_levelname_ui_2/PROJECT_S2_MENU_UI/PROJECT_S2_hover_button_shadow_ui/PROJECT_S2_hover_button_shadow_ui_blue/PROJECT_S2_hover_button_shadow_ui_blue.asset
Explanation
To understand the pros and cons, it helps to understand what the path length limit is.
windows path length
You probably already know that a Windows path is a string, that represents where to find a file or folder.
e.g. C:\Program Files\7-Zip
longer folder or file names result in a longer string.
e.g. C:\Program Files\Microsoft Update Health Tools
more folders inside other folders also result in a longer string
e.g. C:\Program Files\Microsoft Update Health Tools\Logs
file path length errors
If you have a lot of folders inside each other, with long names, you might run into an error when trying to use this path in your code.
This is because Windows has a path length limit. An update in windows 10 allows you to disable this limitation. but it doesn't do so by default.
Disabling this limitation allows your computer to use longer paths without errors.
Why does this happen?
The old windows API promised that if you wrote your application correctly, it'd continue to work in the future.
If Windows were to allow filenames longer than 260 characters then your existing application (which used the windows API correctly) would fail.
Microsoft did create a way to use the full 32,768 path names; but they had to create a new API contract to do it. This is the update on windows 10.
read more on why
I'm following an SD install guide and it says "After the python installation, click the "Disable path length limit", then click on "Close" to finish".
I installed Python 3.10.6, since that's what I was using on my last computer. But the install wizard terminated the install without prompting me to disable path length limit. Is it something I really need to do. And if so, is there some way I can do it manually?
Hello John,
My name is Patricia and I am an Independent Advisor. I am here to help you today.
Disable the path limit length is recommended after Python setup is successful, because if python was installed in a directory with a path length greater than 260 characters, adding it to the path could fail.
So don't worry about that action and proceed to it.
Hi JohnRamos2 !
My name is Saylis. I am an Independent Advisor and I would very much like to help you with your problem. We will work together and we will solve it.
In this link the recommendation is to enable the path length limit and give examples of why to do it:
https://stackoverflow.com/questions/51624449/py...
I would appreciate it if you would review it and comment if it solves your problem, otherwise we keep in contact to arrive at the solution.
Kind Regards,
Sally C.S
If the answer was useful, please check Yes in: Did this solve your problem? So you will also help the community.
"If you're afraid to ask, you risk not learning."
Así que acabo de instalar Python 3.10.5 y la configuración me dio la opción de deshabilitar el límite de longitud de ruta y no tengo ni idea de qué es eso porque nunca antes había codificado y esta es la primera vez.
Las versiones antiguas de Windows tienen un límite en la longitud de algunos archivos, si no me equivoco, entonces 260 +- y, por lo tanto, al instalar Python se le pregunta sobre el límite. No importa mucho, pero por ejemplo, los programas antiguos de 32 bits tienen un límite de 260, es decir, si alguna vez escribes un script para algunos programas antiguos de 32 bits, tendrás problemas.
Por lo tanto, puedes incluir.
para any1 del futuro, solo asegúrese de hacer clic en la opción deshabilitar límite de ruta. te salva de errores extraños
I'm debating installing from Python.org or Chocolatey. I just wanna know if that max path limit is bypassed in Chocolatey's installation.
Our org has as lot of paths like:
W:\VeryImportantDataThatAbsolutelyNeedsToBeNestedDeeplyForSecurityReasonsAndNoOneWillEverFindItUnlessTheyKnowTheExactPathBecauseItsSoRidiculouslyLongTheyllGiveUpTryingToNavigateThroughAllTheseFolders\TopSecretFilesThatContainInformationAboutThingsThatAreSoSecretWeCantEvenNameThemButJustKnowTheyreSuperImportantAndIfTheyGotOutItWouldBeVeryBadSoWeNeedToHideThemReallyWell\ProjectAlphaOmegaSuperDuperConfidentialStuffDoNotOpenUnderPenaltyOfLawSeriouslyWeMeanItThisTime\InternalDocumentsForAuthorizedPersonnelOnlyBeyondThisPointYouShallNotPassUnlessYouHaveTheSecretHandshakeAndPasswordWhichChangesDailyAndIsBroadcastViaCarrierPigeon\PhaseThreeContingencyPlanExecuteOrder66ButOnlyIfTheSituationIsReallyReallyBadLikeAlienInvasionOrSomethingEquallyUnlikely\SubFolderLevelFortyTwoTheAnswerToLifeTheUniverseAndEverythingIsProbablyNotHereButWhoKnowsMaybeItsHiddenInThisRidiculouslyNamedFolder\EvenDeeperIntoTheRabbitHoleWeGoWhereTheFilesAreShyAndDontLikeToComeOutToPlaySoWeHaveToSneakUpOnThemVeryQuietly\JustALittleBitFurtherAlmostThereKeepGoingYoureDoingGreatDontGiveUpNowYoureSoCloseToSeeingTheMostSecretFileEver\TheFinalSanctumOfTheHiddenFilesPrepareToBeAmazedByTheSheerLengthOfThisFolderPathItsTrulyAWorkOfArtInItsOwnRight\ThisIsTheActualFileNameYoureLookingForBelieveItOrNotItsFinallyHere.txt
Then we get the occasional issue with "it's not saving" or "it won't open." Without the more obvious solutions which would involve the users doing something, would a simple reg change to remove the path limit on workstations as well as the file servers pose much of a risk? We're on Win 10 22H2 Ent LTSC, file servers on 2019. However I think (gotta confirm) that we may be on the 32 bit version of Office 2021.
Thanks.