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 Overflow
Top answer
1 of 5
109

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.

2 of 5
27

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

🌐
Reddit
reddit.com › r/stablediffusion › sd installation, unable to disable path length limit
r/StableDiffusion on Reddit: SD installation, unable to disable path length limit
June 8, 2025 -

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?

🌐
Reddit
reddit.com › r/learnpython › [deleted by user]
[deleted by user] : r/learnpython
March 16, 2024 - AFAIK it shouldn't affect it. ... Was trying to run a notebook in VS Code because the browser version wasn't working - saved my life! ... I still have to reorder my path cause everyone wants to be first so their stuff works, but I’d really prefer my python stay up top so it loads faster.
🌐
Reddit
reddit.com › r › learnpython › comments › o7k2gv › why_i_dont_have_the_option_to_disable_the_path
Reddit - The heart of the internet
June 25, 2021 - Hi, so there is my problem, i've downloaded Python v3.9.5 and at the end of the installation, it doesn't tell me if i wanna disable the path lenght limit (i activated the option to add Python to path)
Find elsewhere
🌐
HowToSolutions
howtosolutions.net › 2022 › 08 › disable-path-length-limit-option-in-python-installation
All about "Disable path length limit" in Python installation
August 18, 2022 - Changes your machine configuration to allow programs, including Python to bypass the 260 character "MAX_PATH" limitation. Clicking on it will remove the Windows filesystem limitation of 260 characters for paths that include folder path with ...
🌐
CodeGenes
codegenes.net › blog › should-i-disable-path-length-limit-python
Should I Disable Path Length Limit in Python? — codegenes.net
Long File Hierarchies: In some ... the file paths can become very long. Disabling the path length limit allows Python programs to access these files without encountering errors....
🌐
Reddit
reddit.com › r/windowshelp › can a maximum path length limitation deactivation cause problems?
r/WindowsHelp on Reddit: Can a Maximum Path Length Limitation deactivation cause problems?
August 5, 2022 - Over the decades I've spent in IT I've seen enough weird problems with path lengths exceeding the maximum that I now recommend avoiding it if at all possible.
🌐
thetqweb
thetqweb.com › hacking › windows › python-disable-path-length-limit-in-windows
Python Disable Path Length Limit in Windows | thetqweb
May 24, 2022 - “Disable the path limit length” disables the MAX_PATH variable limit on Windows, therefore allowing you to use long Path variables (longer than 260 characters). In Linux-based operating systems and macOS, the Path Length is not an issue.
🌐
Delft Stack
delftstack.com › "delft stack" › "howto" › "python tutorial: how-to guides for everyday python problems" › "how to disable path length limit in python"
How to Disable Path Length Limit in Python | Delft Stack
February 12, 2024 - This code may be used in scenarios ... the path length limitation is acceptable for specific operations. However, such manipulations should be done with caution, considering potential implications on system behavior and file operations.
🌐
YouTube
youtube.com › watch
PYTHON : Python Setup Disabling Path Length Limit Pros and Cons? - YouTube
PYTHON : Python Setup Disabling Path Length Limit Pros and Cons?To Access My Live Chat Page, On Google, Search for "hows tech developer connect"Here's a secr...
Published: May 21, 2023
🌐
Reddit
reddit.com › r/sysadmin › what are the potential risks of disabling the path character limit system wide? we tend to run into issues with the default limitation.
r/sysadmin on Reddit: What are the potential risks of disabling the path character limit system wide? We tend to run into issues with the default limitation.
May 10, 2025 -

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.

🌐
Python.org
discuss.python.org › peps
PEP 773: A Python Installation Manager for Windows - Page 8 - PEPs - Discussions on Python.org
April 21, 2025 - Hi all. I am excited to share my proposal for replacing (over usual deprecation periods) the Windows installers (plural) with a single tool for downloading, installing, updating, and managing installs. This preserves ou…
🌐
Python Pool
pythonpool.com › home › tutorials › enable long file paths for python on windows
How to Disable Path length Limit in Python
July 13, 2026 - Using Path does not remove Windows limits by itself, but it keeps path construction predictable while you debug length and folder issues. Avoid manually concatenating strings with backslashes.