OSError:[Errno 8]流浪汉中的Exec格式错误

时间:2019-05-20 18:09:33

标签: python flask

每当我在流浪汉中运行Application.py时,它就会显示:OSError:[Errno 8] Exec格式错误。

我尝试过shebangs(曾在win 8笔记本电脑上工作过),但即使在相同的无所事事的环境下,也无法在win 10上使用。最后一个有效的shebang是这个#!/ usr / bin / env python2.7

application.py

<div class="container my-12 mx-auto bg-gray-400">
            <div className="flex flex-wrap ">
              {error ? <p>{error.message}</p> : null}
              {!isLoading ? (
                users.map(user => {
                  const { username, name, email } = user;
                  return (
                    <div key={username} className="w-full p-5 md:w-1/2 lg:w-1/3">
                      <article className="overflow-hidden rounded-lg shadow-lg">
                        <img alt="Placeholder" className="w-full" src="https://picsum.photos/600/400/?random" />
                        <header className="flex items-center justify-between leading-tight p-2 bg-white">
                          <h1 className="text-lg">{name}</h1>
                          <p className="text-grey-darker text-sm">
                            {email}
                          </p>
                        </header>
                      </article>
                    </div>

错误消息

from flask import Flask, render_template, request, redirect, url_for, flash, jsonify
app = Flask(__name__)

from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from database_setup import Base, Category, CatItem

engine = create_engine('sqlite:///catalog_datbase.db')
Base.metadata.bind = engine

DBSession = sessionmaker(bind=engine)
session = DBSession()


@app.route('/')
def Home():

    return render_template('index.html')


@app.route('/login')
def Login():

    return render_template('login.html')


@app.route('/catalog/<int:category_id>/items')
def Items(category_id):

    return render_template('items.html')


@app.route('/catalog/<int:category_id>/<int:catitem_id>/')
def Item(category_id, catitem_id):

    return render_template('item.html')


@app.route('/catalog/<int:catitem_id>/edit')
def EditItem(catitem_id):

    return render_template('edit.html')


@app.route('/catalog/<int:catitem_id>/delete')
def DeleteItem(catitem_id):

    return render_template('delete.html')


@app.route('/catalog/create')
def CreateItem():

    return render_template('create.html')


if __name__ == '__main__':
    app.secret_key = 'Key'
    app.debug = True
    app.run(host='0.0.0.0', port=5000)

0 个答案:

没有答案