asp.net调用python问题
qyr20 2019-02-15 02:16:21 python文件中中有个引用类库的方法(大概是吧,我不懂):from PIL import Image
在后台调用这个文件时总是报错:No module named PIL,不懂python,也没这么用过,只能求助大家了。
查找路径我设置了,跟系统设置的一样,还是不管用
ICollection<string> Paths = Engine.GetSearchPaths();
string strVar = Environment.GetEnvironmentVariable("PATH", EnvironmentVariableTarget.Machine);
if (strVar != null)
{
foreach (var v in strVar.Split(';'))
{
if (v.ToLower().IndexOf("python") != -1)
Paths.Add(v);
}
}
Paths.Add("//Lib");
Paths.Add("//Lib//site-packages");
Paths.Add(AppDomain.CurrentDomain.BaseDirectory + "bin");