Almenon / AREPL-vscode

Program python in real-time
MIT License
264 stars 33 forks source link

There is no more input #271

Closed vvscode closed 5 years ago

vvscode commented 5 years ago

Just installed extension (1.0.17). Choose AREPL: execute python in real time (new doc) and see next:

Print Output:
  File "/Users/vvscode/.vscode/extensions/almenon.arepl-1.0.17/node_modules/arepl-backend/python/python_evaluator.py", line 110
    raise StopIteration("There is no more input") from None
                                                     ^
SyntaxError: invalid syntax

In log file:

Error: ENOENT: no such file or directory, open '/Users/vvscode/repo/stepik-python-authomation-homework/Untitled-1'

[2019-09-02 10:53:27.747] [renderer3] [error]   File "/Users/vvscode/.vscode/extensions/almenon.arepl-1.0.17/node_modules/arepl-backend/python/python_evaluator.py", line 110
    raise StopIteration("There is no more input") from None
                                                     ^
SyntaxError: invalid syntax
: Error:   File "/Users/vvscode/.vscode/extensions/almenon.arepl-1.0.17/node_modules/arepl-backend/python/python_evaluator.py", line 110
    raise StopIteration("There is no more input") from None
                                                     ^
SyntaxError: invalid syntax

    at PythonShell.parseError (/Users/vvscode/.vscode/extensions/almenon.arepl-1.0.17/node_modules/python-shell/index.js:268:21)
    at terminateIfNeeded (/Users/vvscode/.vscode/extensions/almenon.arepl-1.0.17/node_modules/python-shell/index.js:139:32)
    at ChildProcess.<anonymous> (/Users/vvscode/.vscode/extensions/almenon.arepl-1.0.17/node_modules/python-shell/index.js:131:13)
    at ChildProcess.emit (events.js:187:15)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
Almenon commented 5 years ago

That's because your pythonpath is pointing to python 2. AREPL requires python 3 to work.

You can change either the python.pythonpath or arepl.pythonpath setting to python3 and it should work. (AREPL will automatically use python.pythonpath setting if arepl.pythonpath is not configured)

Almenon commented 5 years ago

I have code in arepl to show a warning when python 2 is used, I'm not sure why it didn't activate :(

        PythonShell.getVersion(`"${pythonPath}"`).then((out)=>{
            if(out.stdout){
                if(out.stdout.includes("Python 2.")){
                    vscode.window.showErrorMessage("AREPL does not support python 2!")
                }
            }
        })

I'll create a new issue for that.