-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Pythonnet could not loaded on other PC #7412
Comments
If it is related to security (e.g., your local security policy preventing program from loading collected DLLs, or your anti-virus program blocking them), there's nothing we can really do about it. Same goes for cases when .NET runtime is missing on the target machine. What .NET runtime are you supposed to be using? Unless specified via |
@rokm |
Does this happen with just Japanese characters, or any non-ASCII character? Can you provide a minimal example that triggers the error for you? E.g., is error triggered by import clr
print("Hello world!") or does it require some additional code (like explicitly choosing particular runtime before importing |
@rokm |
OK, I've reproduced the problem. Let's reopen this until I figure whether it's our bug or not. |
I don't think this is our bug, because I can reproduce the same error with E.g., trying to run this code: import sys
if len(sys.argv) > 1 and sys.argv[1] == 'coreclr':
# Use .NET core runtime
from clr_loader import get_coreclr
from pythonnet import set_runtime
set_runtime(get_coreclr())
else:
# Use .NET framework runtime - this is the default
#from clr_loader import get_netfx
#from pythonnet import set_runtime
#set_runtime(get_netfx())
pass
import clr
from System import String
s = String("Hello world!")
print(s) fails with (the default) .NET Framework runtime:
but works with the .NET Core runtime:
Which seems to imply that either If switching to .NET Core runtime is an option for you, you could do that to take care of non-ASCII paths. |
@rokm |
I get this error when running our packaged app on other PC:
this line : File "repositories\yyyy_repository.py", line 6, in is:
import clr
I've tried many ways but didn't work. There are some PC when I unblock dll file (python.runtime.dll, etc..) then it worked, but there are some PC don't (i also tested it on windows 11). I'm pretty sure it is related to security.
The text was updated successfully, but these errors were encountered: