ironpython3
ironpython3 copied to clipboard
future feature is not defined:annotations
python: 3.11.2 ironpython: 3.4.0 vs studio: vs 2022
Description
` ScriptRuntime pyRuntime = Python.CreateRuntime();
var engine = Python.CreateEngine();
var pyScope = engine.CreateScope();
var paths = engine.GetSearchPaths();
string pathToVirtualEnv = @"C:\Program Files\Python311";
paths.Add(pathToVirtualEnv +@"\Lib");
paths.Add(pathToVirtualEnv + @"\Lib\site-packages");
paths.Add(pathToVirtualEnv + @"\DLLs");
engine.SetSearchPaths(paths);
dynamic py = engine.ExecuteFile(AppContext.BaseDirectory + @"IAMed/prescript_cluster.py");
`
when run at " dynamic py = engine.ExecuteFile(AppContext.BaseDirectory + @"IAMed/prescript_cluster.py");"
show error: future feature is not defined:annotations
__future__.annotations was added in Python 3.7 and so is not available in IronPython 3.4 (which is based on Python 3.4).