首页 > 解决方案 > System.IO.FileNotFoundException:在语言的搜索路径中找不到“文件'Test.py':。”

问题描述

每当我运行此脚本时,都会收到以下错误:

System.IO.FileNotFoundException:在语言的搜索路径中找不到“文件'Test.py':。”

var ipy = Python.CreateRuntime();
dynamic test = ipy.UseFile("Test.py");
test.Simple();//Simple is a method in the python script

标签: c#pythonironpython

解决方案


您应该转到 Test.py 属性窗口并将“复制到输出目录”更改为“始终复制”。


推荐阅读