Skip to content
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

Windows installation fails with error: could not create 'build\bdist.win-amd64\wheel\.\idaes\core\surrogate\tests\data\onnx_models\net_st_net_5000_STM_100_s_2000000_60_5_tanh_1e-06 _4096_tr_15481_Calcite_ST_idaes_info.json': No such file or directory #1540

Closed
lbianchi-lbl opened this issue Nov 22, 2024 · 5 comments · Fixed by #1545 · May be fixed by #1541
Assignees
Labels
bug Something isn't working Priority:High High Priority Issue or PR

Comments

@lbianchi-lbl
Copy link
Contributor

lbianchi-lbl commented Nov 22, 2024

@lbianchi-lbl
Copy link
Contributor Author

I was able to confirm that this is indeed caused by file path length limitations:

  1. In a Powershell prompt, run the following "cmdlet" to check whether long paths are supported or not (0: long paths not supported; 1: long paths supported):
Get-ItemProperty -Path "HKLM:System\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled"
  1. Run the pip install command above (it should fail if LongPathsEnabled is 0)
  2. Open a Powershell prompt with "Run as Administrator" to enable support for long paths:
Set-ItemProperty -Path "HKLM:System\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1
  1. Run the pip install command above, which should now pass

For more information: https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry#enable-long-paths-in-windows-10-version-1607-and-later

@lbianchi-lbl
Copy link
Contributor Author

From more testing, I think I figured out the exact path that causes the error, at 262 characters when the default length without LongPathsEnabled is 260:

C:\Users\lbian\AppData\Local\Temp\pip-install-is8sb24x\idaes-pse_f27d74dd25594348bdef5015371f125f\build\bdist.win-amd64\wheel\.\idaes\core\surrogate\tests\data\onnx_models\net_st_net_5000_STM_100_s_2000000_60_5_tanh_1e-06_4096_tr_15481_Calcite_ST_idaes_info.json

Assuming this is true, and that the pattern for name mangling that pip uses is fixed in length, then the filename just happens to be long enough to go over the threshold by 2 characters 🙃

@fahim831
Copy link

When I tried the above solution, i.e.,
Set-ItemProperty -Path "HKLM:System\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1
on a Windows virtual machine via Citrix, I get this error:

Set-ItemProperty : Requested registry access is not allowed.
At line:1 char:1
+ Set-ItemProperty -Path "HKLM:System\CurrentControlSet\Control\FileSys ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (HKEY_LOCAL_MACH...trol\FileSystem:String) [Set-ItemProperty], Securit
   yException
    + FullyQualifiedErrorId : System.Security.SecurityException,Microsoft.PowerShell.Commands.SetItemPropertyCommand

@lbianchi-lbl
Copy link
Contributor Author

lbianchi-lbl commented Nov 27, 2024

When I tried the above solution, i.e., Set-ItemProperty -Path "HKLM:System\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 on a Windows virtual machine via Citrix, I get this error:

Set-ItemProperty : Requested registry access is not allowed.
At line:1 char:1
+ Set-ItemProperty -Path "HKLM:System\CurrentControlSet\Control\FileSys ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (HKEY_LOCAL_MACH...trol\FileSystem:String) [Set-ItemProperty], Securit
   yException
    + FullyQualifiedErrorId : System.Security.SecurityException,Microsoft.PowerShell.Commands.SetItemPropertyCommand

Thanks for the feedback @fahim831. As I mentioned in my comment above, the Set-ItemProperty command needs to be run as administrator (which, depending on how your machine is configured, might not be possible to ordinary users).

Also, #1545 should have resolved this error, so commands such as pip install "idaes-pse @ git+https://github.com/IDAES/idaes-pse@main should work as expected now.

@fahim831
Copy link

@lbianchi-lbl Thank you! I did run it with Admin privileges, which is why I was confused it didn't work. But the #1545 solution worked, using pip install git+ for both idaes and then watertap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Priority:High High Priority Issue or PR
Projects
None yet
2 participants