在.net应用程序中安装IronPython需要哪个版本的Python

2024-06-13 16:16:36 发布

您现在位置:Python中文网/ 问答频道 /正文

我将ironpython2.7.7从nuget安装到我的控制台应用程序。我的系统里已经有Python36了。在

我的代码

var ipy = Python.CreateRuntime();
        var engine = Python.CreateEngine();
        ICollection<string> paths = engine.GetSearchPaths();
        string dir = @"C:\Users\MyUser\AppData\Local\Programs\Python\Python36\Lib\";
        paths.Add(dir);
        string dir2 = @"C:\Users\MyUser\AppData\Local\Programs\Python\Python36\Lib\site-packages\";
        paths.Add(dir2);
        engine.SetSearchPaths(paths);
        dynamic test = ipy.UseFile(@"C:\ConsoleApplication1\ConsoleApplication1\Test1.py");
        test.Simple();

代码输入测试.py在

^{pr2}$

它显示出一个例外

No module named nltk.classify.util

这里少了什么?在


Tags: 代码addstringvarliblocaldirusers