6

Whenever I run my program using the command python app.py on Ubuntu on Windows it displays this entire message. Seems to me that it runs for a bit then crashes. I honestly have no clue where in my code the error is at, doesn't seem to show on the picture either. All it shows is the OSError: [Errno 8] Exec format error. Can someone please explain why I am getting this error? This is not a duplicate thread since I am not using docker and that error is different.


The code I am using:

from flask import Flask, render_template, request, session, logging, url_for, redirect, flash
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker


from passlib.hash import sha256_crypt
20
  • What if you just run 'python'? This looks like it might have nothing to do with your program. Commented Mar 24, 2019 at 3:34
  • @Steve I tried that out just now and it just gives me the GCC for it. Please see the modified post with the image url named"Just running 'python'. Commented Mar 24, 2019 at 3:40
  • Do not share screenshots of code or text output. Instead, copy/paste the code itself. You also should supply more information about the issue: what environment is it running in, what library versions you are using, what have you tried so far to fix it... Commented Mar 24, 2019 at 3:42
  • 2
    Possible duplicate of Flask CLI throws 'OSError: [Errno 8] Exec format error' when run through docker-compose Commented Mar 24, 2019 at 3:45
  • It is not a duplicate. I have the tag ubuntu-18.04, because I am using that environment. Like I said, I do not know where in my program I am getting the error. If I did, I would be more than happy to provide that snippet. @swalladge Commented Mar 24, 2019 at 3:46

2 Answers 2

14

I encountered the same problem and this is how i solved it:

I uninstalled the werkzeug version that was initially installed

pip uninstall werkzeug

Then i re-installed werkzeug 0.14.1 version. That solved it for me.

pip install --upgrade werkzeug==0.14.1

Here's a link on how to upgrade/downgrade werkzeug

Sign up to request clarification or add additional context in comments.

2 Comments

Please get the commands from the url and put it on your answer as it will improve its quality.
Thank you so much, mine was 0.15.2 and working well after downgrade to 0.14.1
1

Please check: Flask CLI throws 'OSError: [Errno 8] Exec format error' when run through docker-compose

"There is a bug with werkzeug 0.15.1 and docker. Downgrading it to werkzeug==0.14.1 worked for me."

Also for me...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.