[英]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.