Skip to content

seval: giving: KeyError: <class '_ast.Import'> #5

@sant527

Description

@sant527

I am using windows 10 and have python 3.6 and have a virtualenv setup. inside virtualenv i have installed

pip install git+git://github.com/ellxc/seval
pip install anyreadline

I have a simple python script

test.py

a=10
b=a+10
print(b)

and did

python -m seval test.py > result.txt

then it gives

(venv) D:\Dev\Stock-chart\backend>python -m seval test.py
Traceback (most recent call last):
  File "D:\Dev\Stock-chart\backend\venv\lib\site-packages\seval\nodes\evals.py", line 68, in eval_stmt
    t = stmts[type(node)].evaluate(env, node)
KeyError: <class '_ast.Import'>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\dev\appdata\local\programs\python\python38-32\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\dev\appdata\local\programs\python\python38-32\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "D:\Dev\Stock-chart\backend\venv\lib\site-packages\seval\__main__.py", line 8, in <module>
    parse_file(f)
  File "D:\Dev\Stock-chart\backend\venv\lib\site-packages\seval\seval.py", line 27, in parse_file
    eval_stmt(env, stmt_or_expr, blacklist)
  File "D:\Dev\Stock-chart\backend\venv\lib\site-packages\seval\nodes\evals.py", line 74, in eval_stmt
    raise NotImplementedError(str(type(node)) + " on line: " + str(node.lineno))
NotImplementedError: <class '_ast.Import'> on line: 1

even i tried

(venv) D:\Dev\Stock-chart\backend>python -m seval
getting repl...

it hangs there

how can i run python script with multiple lines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions