1

I'm working through Miguel Grinberg's Flask Mega-Tutorial, and am unable to run the basic app in Part I. I am using Ubuntu, and getting the following traceback:

Traceback (most recent call last):
  File "./run.py", line 2, in <module>
    from app import app
  File "/home/makisupa43/dev/microblog/app/__init__.py", line 1, in <module>
    from flask import Flask
ImportError: No module named flask

I have double checked code and all looks correct. Not sure if I'm getting screwed up with VirtualEnv or if it is a separate issue.

3
  • Have you done pip install flask inside of your virtualenv? Commented May 21, 2014 at 0:39
  • @HuuNguyen yes I am inside my virtualenv and have run pip install flask. Commented May 21, 2014 at 1:16
  • What is the output of flask/bin/pip freeze ? Commented May 21, 2014 at 2:02

1 Answer 1

1

Reading through the tutorial, it looks like Miguel skips the step where you actually activate the virtual environment. Run this command from the directory where you're doing all your pip installs:

. flask/bin/activate

This should put you in the correct virtual environment, which will make everything you've installed with pip available to your run.py script.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.