Im using IronPython on C#.Net 3.5 app with VS 2015. I read all the post about this Topic, but still get this error. my code:
static void Main(string[] args)
{
var engine = Python.CreateEngine();
var searchPaths = engine.GetSearchPaths();
searchPaths.Add(@"C:\myProject\packages\DynamicLanguageRuntime.1.1.2");
searchPaths.Add(@"C:\myProject\packages\IronPython.2.7.7\lib");
searchPaths.Add(@"C:\myProject");
searchPaths.Add(@"C:\myProject\"where myfile.py exists");
engine.SetSearchPaths(searchPaths);
var mainfile = @"C:\myProject\myfile.py";
var scope = engine.CreateScope();
engine.CreateScriptSourceFromFile(mainfile).Execute(scope);
var result = scope.GetVariable("res");
// Console.WriteLine(result);
Console.ReadKey();
}
and myfile.py start with :
import os
import csv
import unirest
.
.
res = "something"
Does someone knows what can be the problem? Thanks.