Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

I keep getting the error no module named flask.

I keep getting the error no module named flask when I try to run the server. I looked up the problem and people say that you need to activate the virtualenv (which I did) or check to see if python was installed (which it was). The code that keeps activating this error is: from flask import Flask

3 Answers

Hi askariabdurrahman

Is flask installed in your virtual environment ? to check activate your virtual environment and run pip freeze does it show flask installed?

Can you post the code from your app please. Did you install flask? What version of flask are you running? Is it possible you installed flask for python3 and are running python2.7 or vice versa?

You can also run python from the console (just type python) and when you see the prompt >>> type from flask import Flask and see if you get the same error message. If everything is installed in the correct place you shouldn't see any errors.

did you do: sudo pip install flask in the terminal?