简体   繁体   English

未能在此系统上创建默认的 .NET 运行时,它本来是 .netfx”

[英]Failed to create a default .NET runtime which would have been "netfx" on this system

I am trying run a python script that is importing clr as below:我正在尝试运行一个导入 clr 的 python 脚本,如下所示:

import clr

But i am getting the following error while executing the python scripts:但是在执行 python 脚本时出现以下错误:

Failed to create a default .NET runtime which would have been .netfx" on this system. Either install a compatible runtime or configure explicitly via 'set_runtime' or the 'PYTHO.NET_*' environment variables (see set_runtime_from_env)无法在该系统上创建默认的 .NET 运行时,它本来是 .netfx”。安装兼容的运行时或通过“set_runtime”或“PYTHO.NET_*”环境变量显式配置(参见 set_runtime_from_env)

I had the same problem and fixed it with this description found on github .我遇到了同样的问题,并使用github 上的描述修复了它。

from pythonnet import load
load('coreclr')
import clr

I don't really know what caused the problem in my case, as it ran without problems before (maybe python/pytho.net update?).我真的不知道是什么导致了我的问题,因为它之前运行没有问题(也许是 python/pytho.net 更新?)。 But it seems that the problem is that the wrong .NET installation is loaded.但是好像问题是加载了错误的.NET安装。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 .NET Web API项目错误CS1703:已导入具有相同标识的多个程序集:System.Runtime.Serialization.Primitives.dll - .NET Web API project Error CS1703: Multiple assemblies with equivalent identity have been imported: System.Runtime.Serialization.Primitives.dll 如何查看已在.Net中加载了哪些类 - How to see which classes have been loaded in .Net 默认的.NET运行时版本 - Default .NET Runtime Version 如何正确找到针对其构建程序集的.NET运行时? - How can I correctly find the .NET runtime against which an assembly has been built? C#/。NET - 查看系统事件列表,即。 已显示的Windows,已单击的按钮等 - C#/.NET - View a list of system events ie. Windows that have been displayed, buttons that have been clicked etc 允许像VB6 .EXE一样部署.NET控制台应用程序 - Allowing .NET console application to be deployed like VB6 .EXE would have been 在.net system.io.compression.gzipstream压缩的Java中解压缩(解压缩)文件 - decompress (unzip) file in java that have been compressed by .net system.io.compression.gzipstream pop3邮件客户端(openpop.net)无法获取已被SurfControl plc扫描的邮件 - pop3 mail client(openpop.net) failed to get a mail which has been scanned by SurfControl plc NET的ARCGIS运行时:为什么我得到System.ArgumentException'已经添加了具有相同键的项'? - ARCGIS Runtime for .NET: Why am I getting System.ArgumentException 'An item with the same key has already been added'? 在.NET中创建安装程序包运行时 - Create Setup package runtime in .NET
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM