-
Notifications
You must be signed in to change notification settings - Fork 24
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
Could not find a suitable hostfxr library #40
Comments
I don't have a mac to check this, but could it be that the issue is along the lines of #36, that the |
Seems to be correct, at least it is the same path referenced in the exception |
Also if it helps, here is the .NET information from my system:
|
After stepping through this with debugger, it seems to be a machine architecture mismatch.
But I am unsure why it is expecting x86_64 here. |
Because your Python is x86-64. The architectures have to match. |
Ahh, that is right. After re-installing python from the universal package it is now working properly. Thanks @filmor. |
It makes sense and gives me the insight. Thanks. In my case, I have python architecture arm64, .net architecture arm64, but the host/fxr folder has only these versions:
I need to find out how to make dotnet install hostfxr 6.10. EDITED: because of the |
I copied dotnet/host/fxr/6.0.10 to dotnet/x64/host/fxr leading to this error,
How can I tell to pythonnet that the correct dotnet path /usr/local/share/dotnet (without x64)? @filmor can you advise? |
When I override the dotnet path that pythonnet uses then runtime loads up, from pythonnet import set_runtime
from clr_loader import get_coreclr
rt = get_coreclr(dotnet_root=Path('/usr/local/share/dotnet'))
set_runtime(rt)
import clr |
The lookup code is contained in https://github.com/pythonnet/clr-loader/blob/master/clr_loader/util/find.py, PRs are welcome. I don't have a Mac (and don't plan on getting one anytime soon), so I can't test this behaviour. It looks to me like this previous PR is the culprit: #37 It adjusted the lookup logic to find the dotnet root for 64bit macOS, but it didn't take the architecture into account. |
@filmor Sorry, I also think my previous PR is wrong.. if "ARM" in platform.machine().upper(): If you don't mind, can I send fixed PR? |
dude, you save my time |
Environment
Details
Traceback
The text was updated successfully, but these errors were encountered: