ImportError: cannot import name inspect OpenShift
Question: Trying to deploy my application on OpenShift I'm stuck with this error:

    
    
    Traceback (most recent call last):
      File "app.py", line 35, in <module>
        application = imp.load_source('app', 'flaskapp.py')
      File "flaskapp.py", line 2, in <module>
        from flask_sqlalchemy import SQLAlchemy
      File "/var/lib/openshift/56ad93df7628e163fa00003a/python/virtenv/lib/python2.7/site-packages/
    Flask_SQLAlchemy-2.1-py2.7.egg/flask_sqlalchemy/__init__.py", line 25, in <module>
        from sqlalchemy import orm, event, inspect
    ImportError: cannot import name inspect
    

Searching for answer I learned that the reason is that my Python environment
is somehow broken, but I have no idea how can I fix the OpenShift environment.
What should I do?


Answer: You have a very old version of SQLAlchemy. The `inspect` system was added in
version 0.8, in 2012. The current version is 1.0. Recent Flask-SQLAlchemy
changes dropped support for very old versions of SQLAlchemy. Upgrade to a
newer version.

    
    
    pip install -U sqlalchemy
    

