ironpython3 icon indicating copy to clipboard operation
ironpython3 copied to clipboard

future feature is not defined:annotations

Open zj2050 opened this issue 3 years ago • 1 comments

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

捕获

zj2050 avatar Mar 26 '23 23:03 zj2050

__future__.annotations was added in Python 3.7 and so is not available in IronPython 3.4 (which is based on Python 3.4).

slozier avatar Mar 27 '23 13:03 slozier