I can not start the application in Flask When I enter in the terminal: python app.py following error:

 Traceback (most recent call last): File "app.py", line 2, in <module> from flask import Flask, render_template, request ImportError: No module named flask 

Everything seems to be installed, and pip and flask. Maybe something is missing. ps computer - mac

Thanks in advance for your help!

    1 answer 1

    flask for your python is not installed. You have several python commands on the machine and the pip command starts the wrong python that you expect.

    Create a virtualenv and set the flask there.

    • And then where can I put a folder with my files for the program? - Alex
    • @Alex wherever you want — these are unrelated things. If you don’t understand the words “create virtualenv” or don’t know “how to put flask inside virtualenv”, then ask a separate question, specifically about it. - jfs
    • flask.pocoo.org/docs/0.11/installation seems to have been installed simply by using the tips from this link, but the same error is still issued - Alex
    • @Alex update your question and take steps literally (starting with the commands for creating and activating virtualenv) show how you set the flask (give all the commands and all the errors / warnings they give). Be sure to give the exact commands that you actually used, and a full traceback at the end (if it is at least somewhat different from the one already mentioned in the question). - jfs