Whenever I try "flask run" I get this error in the IDE. I have no idea what the problem actually is.

~/workspace/pset7/survey/ $ flask run
 * Serving Flask app "application.py" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on https://ide50-anton-odman.legacy.cs50.io:8080/ (Press CTRL+C to quit)
 * Restarting with stat
Traceback (most recent call last):
  File "/opt/pyenv/versions/3.6.0/bin/flask", line 10, in <module>
  File "/opt/pyenv/versions/3.6.0/lib/python3.6/site-packages/flask/cli.py", line 894, in main
    cli.main(args=args, prog_name=name)
  File "/opt/pyenv/versions/3.6.0/lib/python3.6/site-packages/flask/cli.py", line 557, in main
    return super(FlaskGroup, self).main(*args, **kwargs)
  File "/opt/pyenv/versions/3.6.0/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/opt/pyenv/versions/3.6.0/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/pyenv/versions/3.6.0/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/pyenv/versions/3.6.0/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/opt/pyenv/versions/3.6.0/lib/python3.6/site-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args[1:], **kwargs)
  File "/opt/pyenv/versions/3.6.0/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/opt/pyenv/versions/3.6.0/lib/python3.6/site-packages/flask/cli.py", line 771, in run_command
    threaded=with_threads, ssl_context=cert)
  File "/opt/pyenv/versions/3.6.0/lib/python3.6/site-packages/werkzeug/serving.py", line 1007, in run_simple
    run_with_reloader(inner, extra_files, reloader_interval, reloader_type)
  File "/opt/pyenv/versions/3.6.0/lib/python3.6/site-packages/werkzeug/_reloader.py", line 326, in run_with_reloader
  File "/opt/pyenv/versions/3.6.0/lib/python3.6/site-packages/werkzeug/_reloader.py", line 312, in ensure_echo_on
    attributes = termios.tcgetattr(sys.stdin)
TypeError: fileno() takes 0 positional arguments but 1 was given
  • Cloud you try flask run --no-reload? Jun 13 '19 at 11:53

There is a similar (exact) error message reported on reddit about 1 month ago. There is no definitive solution.

The OP solved it by rebuilding the workspace. That seems drastic, however, now may be the time to port your workspace from the legacy IDE (cs50.io) to CS50 IDE Beta (ide.cs50.io). (Direction can be found here and here).

It may be as simple as restarting the workspace (CS50 IDE -> Restart Workspace).

Based on the error message flask run --no-reload will likely solve the problem. Be warned, however, you will have to manually bounce flask when you make changes to application.py.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .