Forums

No such file or directory: '/usr/local/bin/uwsgi'

I keep getting this error in my application. I can run the server with no errors from a bash shell, but get this in my error log when I try to reload the site. Any thoughts?

2015-03-23 15:56:27,667 :Traceback (most recent call last):
2015-03-23 15:56:27,667 :  File "/bin/user_wsgi_wrapper.py", line 130, in __call__
2015-03-23 15:56:27,667 :    self.error_log_file.logger.exception("Error running WSGI application")
2015-03-23 15:56:27,667 :  File "/usr/lib/python3.4/logging/__init__.py", line 1296, in exception
2015-03-23 15:56:27,668 :    self.error(msg, *args, **kwargs)
2015-03-23 15:56:27,668 :  File "/usr/lib/python3.4/logging/__init__.py", line 1289, in error
2015-03-23 15:56:27,669 :    self._log(ERROR, msg, args, **kwargs)
2015-03-23 15:56:27,669 :  File "/usr/lib/python3.4/logging/__init__.py", line 1395, in _log
2015-03-23 15:56:27,669 :    self.handle(record)
2015-03-23 15:56:27,669 :  File "/usr/lib/python3.4/logging/__init__.py", line 1404, in handle
2015-03-23 15:56:27,670 :    if (not self.disabled) and self.filter(record):
2015-03-23 15:56:27,670 :  File "/usr/lib/python3.4/logging/__init__.py", line 692, in filter
2015-03-23 15:56:27,670 :    for f in self.filters:
2015-03-23 15:56:27,670 :  File "/bin/user_wsgi_wrapper.py", line 122, in __call__
2015-03-23 15:56:27,671 :    app_iterator = self.app(environ, start_response)
2015-03-23 15:56:27,671 :  File "/bin/user_wsgi_wrapper.py", line 136, in import_error_application
2015-03-23 15:56:27,671 :    raise e
2015-03-23 15:56:27,671 :  File "/bin/user_wsgi_wrapper.py", line 130, in __call__
2015-03-23 15:56:27,671 :    self.error_log_file.logger.exception("Error running WSGI application")
2015-03-23 15:56:27,671 :  File "/usr/lib/python3.4/logging/__init__.py", line 1296, in exception
2015-03-23 15:56:27,672 :    self.error(msg, *args, **kwargs)
2015-03-23 15:56:27,672 :  File "/usr/lib/python3.4/logging/__init__.py", line 1289, in error
2015-03-23 15:56:27,672 :    self._log(ERROR, msg, args, **kwargs)
2015-03-23 15:56:27,672 :  File "/usr/lib/python3.4/logging/__init__.py", line 1395, in _log
2015-03-23 15:56:27,673 :    self.handle(record)
2015-03-23 15:56:27,673 :  File "/usr/lib/python3.4/logging/__init__.py", line 1404, in handle
2015-03-23 15:56:27,674 :    if (not self.disabled) and self.filter(record):
2015-03-23 15:56:27,674 :  File "/usr/lib/python3.4/logging/__init__.py", line 692, in filter
2015-03-23 15:56:27,674 :    for f in self.filters:
2015-03-23 15:56:27,674 :  File "/bin/user_wsgi_wrapper.py", line 122, in __call__
2015-03-23 15:56:27,674 :    app_iterator = self.app(environ, start_response)
2015-03-23 15:56:27,674 :  File "/bin/user_wsgi_wrapper.py", line 136, in import_error_application
2015-03-23 15:56:27,675 :    raise e
2015-03-23 15:56:27,675 :  File "/bin/user_wsgi_wrapper.py", line 130, in __call__
2015-03-23 15:56:27,675 :    self.error_log_file.logger.exception("Error running WSGI application")
2015-03-23 15:56:27,675 :  File "/usr/lib/python3.4/logging/__init__.py", line 1296, in exception
2015-03-23 15:56:27,675 :    self.error(msg, *args, **kwargs)
2015-03-23 15:56:27,676 :  File "/usr/lib/python3.4/logging/__init__.py", line 1289, in error
2015-03-23 15:56:27,676 :    self._log(ERROR, msg, args, **kwargs)
2015-03-23 15:56:27,676 :  File "/usr/lib/python3.4/logging/__init__.py", line 1395, in _log
2015-03-23 15:56:27,677 :    self.handle(record)
2015-03-23 15:56:27,677 :  File "/usr/lib/python3.4/logging/__init__.py", line 1404, in handle
2015-03-23 15:56:27,677 :    if (not self.disabled) and self.filter(record):
2015-03-23 15:56:27,677 :  File "/usr/lib/python3.4/logging/__init__.py", line 692, in filter
2015-03-23 15:56:27,678 :    for f in self.filters:
2015-03-23 15:56:27,678 :  File "/bin/user_wsgi_wrapper.py", line 122, in __call__
2015-03-23 15:56:27,678 :    app_iterator = self.app(environ, start_response)
2015-03-23 15:56:27,678 :  File "/bin/user_wsgi_wrapper.py", line 136, in import_error_application
2015-03-23 15:56:27,678 :    raise e
2015-03-23 15:56:27,678 :  File "/bin/user_wsgi_wrapper.py", line 145, in <module>
2015-03-23 15:56:27,679 :    application = load_wsgi_application()
2015-03-23 15:56:27,679 :  File "/bin/user_wsgi_wrapper.py", line 141, in load_wsgi_application
2015-03-23 15:56:27,679 :    return __import__(os.environ['WSGI_MODULE'], globals(), locals(), ['application']).application
2015-03-23 15:56:27,679 :  File "/var/www/www_genjiglove_com_wsgi.py", line 16, in <module>
2015-03-23 15:56:27,679 :    from flask_app import app as application
2015-03-23 15:56:27,679 :  File "/home/CloudCray/genjiweb/tests/flask_app.py", line 18, in <module>
2015-03-23 15:56:27,680 :    app.run(debug=True)
2015-03-23 15:56:27,680 :  File "/usr/local/lib/python3.4/dist-packages/flask/app.py", line 772, in run
2015-03-23 15:56:27,680 :    run_simple(host, port, self, **options)
2015-03-23 15:56:27,680 :  File "/home/CloudCray/.local/lib/python3.4/site-packages/werkzeug/serving.py", line 622, in run_simple
2015-03-23 15:56:27,681 :    reloader_type)
2015-03-23 15:56:27,681 :  File "/home/CloudCray/.local/lib/python3.4/site-packages/werkzeug/_reloader.py", line 271, in run_with_reloader
2015-03-23 15:56:27,682 :    sys.exit(reloader.restart_with_reloader())
2015-03-23 15:56:27,682 :  File "/home/CloudCray/.local/lib/python3.4/site-packages/werkzeug/_reloader.py", line 143, in restart_with_reloader
2015-03-23 15:56:27,682 :    exit_code = subprocess.call(args, env=new_environ)
2015-03-23 15:56:27,682 :  File "/usr/lib/python3.4/subprocess.py", line 533, in call
2015-03-23 15:56:27,683 :    with Popen(*popenargs, **kwargs) as p:
2015-03-23 15:56:27,683 :  File "/usr/lib/python3.4/subprocess.py", line 848, in __init__
2015-03-23 15:56:27,683 :    restore_signals, start_new_session)
2015-03-23 15:56:27,683 :  File "/usr/lib/python3.4/subprocess.py", line 1446, in _execute_child
2015-03-23 15:56:27,684 :    raise child_exception_type(errno_num, err_msg)
2015-03-23 15:56:27,684 :FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/bin/uwsgi'

Never use app.run() in Flask apps on PythonAnywhere

Thanks - that was it

:-)