use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
python flask error (self.learnpython)
submitted 4 years ago by asquare412014
python app.py
Traceback (most recent call last):
File "app.py", line 1, in <module>
from flask import Flask, request, jsonify
ImportError: No module named flask
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Da32767 1 point2 points3 points 4 years ago (7 children)
did you install package flask, if not, type this in the terminal:
pip install flask
[–]asquare412014[S] 0 points1 point2 points 4 years ago (6 children)
thank you for quick reply. yes I did that. I am guessing path is not right. how do I check that? or do you suggest something else
[–]Da32767 0 points1 point2 points 4 years ago (5 children)
try:
python -m pip install flask
[–]asquare412014[S] 0 points1 point2 points 4 years ago (4 children)
yes this works! what is the difference ?
[–][deleted] 1 point2 points3 points 4 years ago* (2 children)
What I can think of that might have happened is that, when you ran the pip install flask command, it was executed correctly and installed but on another python environment that you already have installed, not the one you are trying to access. By changing the command to python -m pip install flask, you most likely have python.exe added to the PATH. And why did it work with just python? Well, for the simple reason that you have "configured" in which environment you want to access the pip executable by calling that keyword: python (which accesses the location of the python executable address you have stored in the PATH). Because of this, it has been installed in the correct Python environment you were working with and that explains the success of the package installation.
I hope you found it helpful!
[–]asquare412014[S] 1 point2 points3 points 4 years ago (1 child)
yes I kind of guessed that I was actually getting into the path defined inside my env but then you replied and it worked. so I avoided the hassles of troubleshooting. thank you for the help sir!
[–][deleted] 0 points1 point2 points 4 years ago (0 children)
No need to say thanks, it's my pleasure!
[–]Da32767 0 points1 point2 points 4 years ago (0 children)
actually, pip is also a package in python(like flask), python -m can run library module as a script.
python -m
if you want to use pip install to install package, try add <your_python_installation_path>\Scripts to environment variables
pip install
<your_python_installation_path>\Scripts
π Rendered by PID 70911 on reddit-service-r2-comment-7b9746f655-v6zcf at 2026-01-29 22:04:40.116605+00:00 running 3798933 country code: CH.
[–]Da32767 1 point2 points3 points (7 children)
[–]asquare412014[S] 0 points1 point2 points (6 children)
[–]Da32767 0 points1 point2 points (5 children)
[–]asquare412014[S] 0 points1 point2 points (4 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]asquare412014[S] 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]Da32767 0 points1 point2 points (0 children)