python - ImportError: No module when running uwsgi -
i can run server in flask development mode correctly.
i think missing params run uwsgi server got error message.
run uwsgi command
uwsgi --socket 127.0.0.1:4245 --module web --callable app --processes 4 --threads 2
error log
*** operational mode: preforking+threaded *** traceback (most recent call last): file "./web.py", line 19, in <module> model.release_schedule import releaseschedule importerror: no module named model.release_schedule
web.py
#!/usr/bin/env python3 # -*- coding: utf8 -*- flask import request, url_for flask import flask, request, jsonify flask_request_params import bind_request_params flask import g import datetime import pandas pd import pymongo import json webargs import arg webargs.flaskparser import use_args, use_kwargs import yaml import time, functools pdb import set_trace pandas_helper import pandashelper import errors app_helper import * model.release_schedule import releaseschedule model.history import history model.report_type_symbol import reporttypesymbol model.weekly_history import weeklyhistory mongo import mongo # load config file app_cfg = yaml.load(open("app.yml", "r")) msg = yaml.load(open("message.yaml", "r"))
you need add __init__.py
in model folder if want use python package. working in debug mode because parent directory in pythonpath
.
Comments
Post a Comment