Python error: ModuleNotFoundError: No module named'flask'

When I connected with Heroku at the stage of creating LINEbot for the first time in a long time, I got the following error.

ModuleNotFoundError: No module named 'flask'

There are many errors of this hand No module named'XXX', and I checked and solved it every time, but as my solution that is troublesome

Try erasing and reinserting

This turned out to be easy after all (it doesn't seem to be the ultimate solution)

Therefore, perform the following operations on the terminal. (I'm doing it with flask as an example) First, check if the module is installed.

On the terminal

(base) MacBook-puro:*********$ pip show flask
Name: Flask
Version: 1.1.1
Summary: A simple framework for building complex web applications.
Home-page: https://palletsprojects.com/p/flask/
Author: Armin Ronacher
Author-email: [email protected]
License: BSD-3-Clause
Location: /Users/***(username)/opt/anaconda3/lib/python3.7/site-packages
Requires: itsdangerous, Jinja2, click, Werkzeug
Required-by: flask-ngrok, Flask-Compress, dash

If it is displayed like this, you can see that the module itself is included. Officially, the setting from Location is correct, but here I will delete the module and reinsert it.

#Erase and reinsert

pip uninstall flask && python -m pip install flask

This often returns. I think the reason is the location of the path and the version change. I hope you can see other people's articles for the fundamental solution.

Recommended Posts

Python error: ModuleNotFoundError: No module named'flask'
Today's python error: ModuleNotFoundError: No module named
Today's python error: ModuleNotFoundError: No module named
Today's python error: ModuleNotFoundError: No module named'requests'
Today's python error: ModuleNotFoundError: No module named'bs4'
[Python] ModuleNotFoundError: No module named'urlparse'
ModuleNotFoundError: No module named'_bz2' error in pyenv Python
ModuleNotFoundError in Python: No module named story
Import Error in Python3: No module named'xxxxx'
ModuleNotFoundError: No module named'py4j'
ModuleNotFoundError: No module named'flask_sqlalchemy'
Import cv2 ModuleNotFoundError: No module named'cv2' in python3
ModuleNotFoundError in poetry: No module named'setuptools'
What to do when ModuleNotFoundError: No module named'XXX' occurs in Python
Error when installing opencv-python on jetson nano (ModuleNotFoundError: No module named'skbuild')
Microsoft Cognitive Toolkit: ModuleNotFoundError: No module named'cntk._cntk_py'
ModuleNotFoundError: No module named'***' when running Flask
Python module import
Python Error Handling
I get a Python No module named'encodings' error with the aws command
Python collections module
Error when installing a module with Python pip
Solution for "Import Error: No module named requests"
python> import seiral> ImportError: No module named serial
Attempting to install opencv-python3 on jetson nano but error (ModuleNotFoundError: No module named'skbuild')
Python module (Python learning memo ④)
The problem that scikit-learn gives the error No module named'_bz2'
Create a Python module
Python Not Implemented Error
ModuleNotFoundError: No module What to do if you get'tensorflow.contrib'
Today's python error: killed
python original module import
Python error list (Japanese)
[Python] for statement error
I got "ModuleNotFoundError: No module named'azure'" when running a program using Azure SDK for Python
A story about a Python beginner who was about to be crushed by ModuleNotFoundError: No module named'tweepy'
What to do if you get Swagger-codegen in python and Import Error: No module named
A story about a python beginner stuck with No module named'http.server'
Sort Python module imports alphabetically
How Python module import works
About the Python module venv
Automatic update of Python module
[Python] SQLAlchemy error avoidance memorandum
[youtube-dl] python3 SSL error (CERTIFICATE_VERIFY_FAILED)
Error when playing with python
#python Python Japanese syntax error avoidance
Ruby, Python Module Installation Guide
Slice error in python (´ ; ω ; `)
Python debug and test module
Resolve No module named tkinter
Error resolution python version check
How to resolve ModuleNotFoundError: No module named XXX in Jupyter Notebook
Why ModuleNotFoundError: No module named'dataset.mnist' appears in "Deep Learning from scratch".
python / netCDF / CentOS 6.8> ImportError: No module named netCDF4> sudo yum install netcdf4-python.x86_64
Use youtube_dl as a python module. appendix) Nico Nico Douga HTTP 403 error