On Windows, you may encounter the error,
"Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory:"
followed by a long pathname to a file like sharded_mutable_dense_hashtable.cpython-37.pyc.
Typically, this error happens because the depth of the folder path becomes too long.
In this case, set the registry key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem@LongPathsEnabled
to 1 to enable long paths.
Alternately, check where your Python interpreter is installed.
If that location has a long path, try reinstalling in a folder with a shorter path.
Created
March 13, 2020 10:18
-
-
Save rndazurescript/06ff59abfbec061c482734c22d8387d9 to your computer and use it in GitHub Desktop.
Enable long paths on windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$registryPath = "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" | |
$Name = "LongPathsEnabled" | |
$expectedValue = "1" | |
$currentValue=(Get-ItemProperty -Path $registryPath -Name $Name).$Name | |
if ($currentValue -ne $expectedValue){ | |
Write-Host "Enabling long path support" | |
New-ItemProperty -Path $registryPath -Name $name -Value $expectedValue -PropertyType DWORD -Force | Out-Null | |
} | |
else{ | |
Write-Host "Long path support already activated" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment