Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Can I set the CoreCLR version?#2581

Jason5Lee started this conversation inGeneral
Discussion options

I'm trying to usepythonnet with .NET 9 RC. When I triedpythonnet.load("coreclr"), the following error message from .NET was shown.

You must install or update .NET to run this application.App: <python path>Architecture: x64Framework: 'Microsoft.NETCore.App', version '9.0.0' (x64).NET location: <dotnet path>The following frameworks were found:  6.0.33 at [<path>]  8.0.8 at [<path>]  9.0.0-rc-1.24431.7 at [<path>]...

It seems that .NET cannot resolve 9.0.0 with 9.0.0-rc. For my usecase 8.0.8 is OK. Can I make pythonnet to use this version of .NET?

You must be logged in to vote

Replies: 3 comments

Comment options

The function this is failing in ishttps://github.com/pythonnet/clr-loader/blob/master/clr_loader/__init__.py#L89

Is this really the only output you are seeing? There should at least be an exception message after this...

You must be logged in to vote
0 replies
Comment options

I have the similar issue on two Windows 11 machines (In my case it's .net8 solution but requested by pythonnet is .net9):
'python.exe' (Win32): Loaded 'C:\Python311\python.exe'.
'python.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'.
'python.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'.
'python.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'.
'python.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'.
'python.exe' (Win32): Loaded 'C:\Python311\vcruntime140.dll'.
'python.exe' (Win32): Loaded 'C:\Python311\python311.dll'.
'python.exe' (Win32): Loaded 'C:\Windows\System32\ws2_32.dll'.
'python.exe' (Win32): Loaded 'C:\Windows\System32\version.dll'.
'python.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'.
'python.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'.
'python.exe' (Win32): Loaded 'C:\Windows\System32\bcrypt.dll'.
'python.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'.
'python.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'.
'python.exe' (Win32): Loaded 'C:\Program Files\Avecto\Privilege Guard Client\PGHook.dll'.
'python.exe' (Win32): Loaded 'C:\Windows\System32\bcryptprimitives.dll'.
'python.exe' (Win32): Loaded 'C:\Python311\python3.dll'.
'python.exe' (Win32): Loaded 'C:\Python311\DLLs_bz2.pyd'.
'python.exe' (Win32): Loaded 'C:\Python311\DLLs_lzma.pyd'.
'python.exe' (Win32): Loaded 'C:\Python311\Lib\site-packages_cffi_backend.cp311-win_amd64.pyd'. Module was built without symbols.
'python.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'.
'python.exe' (Win32): Loaded 'C:\Windows\System32\win32u.dll'.
'python.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'.
'python.exe' (Win32): Loaded 'C:\Windows\System32\gdi32full.dll'.
'python.exe' (Win32): Loaded 'C:\Windows\System32\msvcp_win.dll'.
'python.exe' (Win32): Loaded 'C:\Windows\System32\imm32.dll'.
'python.exe' (Win32): Loaded 'C:\Windows\System32\psapi.dll'.
'python.exe' (Win32): Loaded 'C:\Windows\System32\kernel.appcore.dll'.
'python.exe' (Win32): Loaded 'C:\Program Files\dotnet\host\fxr\8.0.8\hostfxr.dll'.
You must install or update .NET to run this application.

App: C:\Python311\python.exe
Architecture: x64Framework: 'Microsoft.NETCore.App', version '9.0.0' (x64).NET location: C:\Program Files\dotnet
The following frameworks were found: 3.1.24 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] 5.0.17 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] 6.0.9 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] 6.0.33 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] 7.0.5 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] 7.0.20 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] 8.0.7 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] 8.0.8 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] 9.0.0-preview.7.24405.7 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] 9.0.0-rc.1.24431.7 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Learn more:
https://aka.ms/dotnet/app-launch-failed

To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=9.0.0&arch=x64&rid=win-x64&os=win10'python.exe' (Win32): Unloaded 'C:\Program Files\dotnet\host\fxr\8.0.8\hostfxr.dll'

You must be logged in to vote
0 replies
Comment options

Please do not use the load("coreclr") and try:
from clr_loader import get_coreclr
from pythonnet import set_runtime

rt = get_coreclr(runtime_config="runtimeconfig.json")
set_runtime(rt)

In the runtimeconfig.json replace with your framework
{
"runtimeOptions": {
"tfm": "net8.0",
"framework":
{
"name": "Microsoft.NETCore.App",
"version": "8.0.8"
}
}
}

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
General
Labels
None yet
3 participants
@Jason5Lee@filmor@PawelOHV
Converted from issue

This discussion was converted from issue #2464 on April 11, 2025 04:59.


[8]ページ先頭

©2009-2025 Movatter.jp