1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Installing elasticsearch-HQ I have cannot import name 'Flask' error

Discussion in 'Programming' started by mstdmstd, Nov 22, 2018.

  1. #1
    Hello,
    Under kubuntu 18 I try to install elasticsearch-HQ,as written here http://docs.elastichq.org/installation.html#installation

    But I got error :
    pip install -r requirements.txt
    ...
    Successfully built alembic
    Installing collected packages: jmespath, itsdangerous, MarkupSafe, Jinja2, Werkzeug, click, Flask, pytz, six, aniso8601, Flask-restful, Flask-Script, marshmallow, flask-marshmallow, SQLAlchemy, marshmallow-sqlalchemy, urllib3, idna, certifi, chardet, requests, dogpile.cache, Flask-SQLAlchemy, Mako, python-editor, python-dateutil, alembic, Flask-Migrate, coverage, nose, Flask-Testing, py, pytest, pytest-cov, pytest-ordering, tzlocal, setuptools, funcsigs, futures, apscheduler, Flask-APScheduler, python-engineio, python-socketio, Flask-SocketIO, enum34, greenlet, eventlet
    Successfully installed Flask-0.12.2 Flask-APScheduler-1.7.1 Flask-Migrate-2.3.0 Flask-SQLAlchemy-2.3.2 Flask-Script-2.0.6 Flask-SocketIO-3.0.1 Flask-Testing-0.7.1 Flask-restful-0.3.6 Jinja2-2.10 Mako-1.0.7 MarkupSafe-1.1.0 SQLAlchemy-1.2.0 Werkzeug-0.14.1 alembic-1.0.3 aniso8601-4.0.1 apscheduler-3.5.0 certifi-2018.10.15 chardet-3.0.4 click-7.0 coverage-3.7.1 dogpile.cache-0.6.5 enum34-1.1.6 eventlet-0.23.0 flask-marshmallow-0.8.0 funcsigs-1.0.2 futures-3.2.0 greenlet-0.4.15 idna-2.7 itsdangerous-1.1.0 jmespath-0.9.3 marshmallow-3.0.0b5 marshmallow-sqlalchemy-0.13.2 nose-1.3.4 py-1.7.0 pytest-3.0.2 pytest-cov-2.3.1 pytest-ordering-0.5 python-dateutil-2.7.2 python-editor-1.0.3 python-engineio-2.2.0 python-socketio-2.0.0 pytz-2018.7 requests-2.20.1 setuptools-40.6.2 six-1.11.0 tzlocal-1.5.1 urllib3-1.22
    serge@serge:/mnt/_work_sdb8/wwwroot/elasticsearch-HQ$ python3 application.py
    Traceback (most recent call last):
    File "application.py", line 5, in <module>
    from elastichq import create_app
    File "/mnt/_work_sdb8/wwwroot/elasticsearch-HQ/elastichq/__init__.py", line 1, in <module>
    from flask import Flask
    ImportError: cannot import name 'Flask'
    Code (markup):

    I installed python-flask version (0.12.2-3) and restarted the console, but I have this error anyway .
    Is this some environmental option missing? How to fix it?
    I have not ever used python, no idea how to use it...

    Thanks!
     
    mstdmstd, Nov 22, 2018 IP
  2. shofstetter

    shofstetter Well-Known Member

    Messages:
    178
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    120
    #2
    I could be wrong, but it looks to me like you are using the default pip to do the install. (which is likely pip2 for python 2.7 and you need python 3.4+)
    try the following command instead:
    sudo pip3 install -r requirements.txt

    if it still needs flask try

    sudo pip3 install flask
     
    shofstetter, Feb 1, 2019 IP