Issue with Werkzeug library

Hey everybody,

My code works perfectly fine on my machine, but when I deploy it to Ubuntu server (Ubuntu 20.04 (LTS) x64) I get the following error:

(env) root@ubuntu-s-1vcpu-1gb-intel-nyc1-01:~/demo# python

  • Serving Flask app “demo” (lazy loading)
  • Environment: production WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
  • Debug mode: on
  • Running on all addresses. WARNING: This is a development server. Do not use it in a production deployment.
  • Running on (Press CTRL+C to quit)
  • Restarting with stat Killed (env) root@ubuntu-s-1vcpu-1gb-intel-nyc1-01:~/demo# * Debugger is active!
  • Debugger PIN: 521-632-002 Traceback (most recent call last): File “/root/demo/”, line 4, in <module>‘’) File “/root/demo/env/lib/python3.8/site-packages/flask/”, line 990, in run run_simple(host, port, self, **options) File “/root/demo/env/lib/python3.8/site-packages/werkzeug/”, line 1000, in run_simple _rwr( File “/root/demo/env/lib/python3.8/site-packages/werkzeug/”, line 418, in run_with_reloader ensure_echo_on() File “/root/demo/env/lib/python3.8/site-packages/werkzeug/”, line 398, in ensure_echo_on termios.tcsetattr(sys.stdin, termios.TCSANOW, attributes) termios.error: (5, ‘Input/output error’)

What could be the problem?

Thank you so much for your help! niko

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Not entirely sure of what might cause this, but input/output error might have to do with permissions. Is this writing to the terminal or a (virtual?) serial port?

In the latter case, make sure you are added to the correct group (modem, I believe, then logout and login again).

In the former, check who owns the python script you’re trying to run. Go to the folder where is located and run ls -lh Try running as root (sudo python to see if it fixes it.

If it works under sudo, it is most likely a permissions issue.

If you’ve uploaded the file as root, then the regular user may not be allowed to run the script (just a thought).