Flask-Script invalid syntax error

39 Views Asked by At

I try to publish the site created by Flask on AWS. I am trying it with the test code and confirming that there is no problem.

test code ↓

# -*- coding: utf-8 -*-
from flask import Flask
app = Flask(__name__)

@app.route("/")
def hello():
    return "Hello World!"

if __name__ == "__main__":
    app.run()

But Flask-Script does not work well.

manage.py ↓

# -*- coding: utf-8 -*-
from __future__ import print_function
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from flaskr import app, db

migrate = Migrate(app,db)

manager = Manager(app)
manager.add_command('db', MigrateCommand)

if __name__ == '__main__':
    manager.run()

Error message ↓

Traceback (most recent call last):
  File "./manage.py", line 3, in <module>
    from flask_script import Manager
  File "/root/.pyenv/versions/3.6.2/lib/python3.6/site-packages/flask_script.py", line 648
    print self.get_usage()
             ^
SyntaxError: invalid syntax 

Where is wrong?

→I fixed.

pip install 'Flask-Script==2.0.6'
0

There are 0 best solutions below