Forums

Error code: Unhandled Exception

Error running WSGI application

   <pre>File "/home/danguddemi/.local/lib/python3.6/site-packages/concurrent/futures/_base.py", line 381

     raise exception_type, self._exception, self._traceback

                         ^
<code>
Traceback (most recent call last):
  File "/home/danguddemi/mysite/routes.py", line 1, in <module>
    from flask import Flask, render_template, request

  File "/usr/local/lib/python3.6/dist-packages/flask/__init__.py", line 19, in <module>
    from jinja2 import Markup, escape

  File "/usr/local/lib/python3.6/dist-packages/jinja2/__init__.py", line 81, in <module>
    _patch_async()

  File "/usr/local/lib/python3.6/dist-packages/jinja2/__init__.py", line 77, in _patch_async
    from jinja2.asyncsupport import patch_all

  File "/usr/local/lib/python3.6/dist-packages/jinja2/asyncsupport.py", line 13, in <module>
    import asyncio

  File "/usr/lib/python3.6/asyncio/__init__.py", line 21, in <module>
    from .base_events import *

  File "/usr/lib/python3.6/asyncio/base_events.py", line 17, in <module>
    import concurrent.futures

  File "/home/danguddemi/.local/lib/python3.6/site-packages/concurrent/futures/__init__.py", line 8, in <module>
    from concurrent.futures._base import (FIRST_COMPLETED,

  File "/home/danguddemi/.local/lib/python3.6/site-packages/concurrent/futures/_base.py", line 381
    raise exception_type, self._exception, self._traceback
                        ^
SyntaxError: invalid syntax

Not exactly sure what is happening here. I'm not running in a virtual environment and I am pretty sure that the WSGI file is set up correctly

[edited by admin for formatting]

A syntax error usually means there's a mismatch between the code you're trying to run, and the python version that's running it. What Python version is your webapp using? And could the code that you installed with --user be the wrong version somehow?

A virtualenv might be a good way to get more clarity on what's installed where...