[PYTHON] When I name the file flask.py in Flask, I get Import Error: cannot import name'Flask'

When using Flask, a framework that makes it easy to create web applications with Python, I got an error that the library could not be read when the file name was "flask.py", so it was a rare error, so make a note.

flask.py


from flask import Flask

`ʻImportError: cannot import name'Flask'`` and Flask cannot be read. Renaming the file will fix it.

Recommended Posts

When I name the file flask.py in Flask, I get Import Error: cannot import name'Flask'
The file name was bad in Python and I was addicted to import
When I get a chromedriver error in Selenium
When I import TensorFlow to Python, I get "Import Error: DLL load failed: The specified module cannot be found."
In the Chainer tutorial, I get an error when importing a package. (mock)
I want to get the file name, line number, and function name in Python 3.4
Get the file name in a folder using glob
I get an Import Error in Python Beautiful Soup
I get an error when I put opencv in pyautoGUI
When I try to import pandas on macOS I get the error No module named'_bz2'
Get the file name saved in AWS S3 (1000 or more)
Get the host name in Python
When I get an error with Pylint in Atom on Windows
Format the Git log and get the committed file name in csv format
I get an error with import pandas.
When I get an error with PyInstaller
If you are told cannot by Python import, review the file name
I can't get the element in Selenium!
What to do when "OS Error: [WinError 126] The specified module cannot be found" appears in import torch
I get an error when I put a Python plugin in Visual Studio Code under the pyenv environment
After installing Anaconda3, I get the error "zsh: no such file or directory:/opt/anaconda3/bin/conda" in the command line preferences.
[Python] I want to know the variables in the function when an error occurs!
I get a strange window when I use the open directory dialog in Tkinter
I want to see the file name from DataLoader
How to get the variable name itself in python
When I try to update the data on DynamoDB with Python (boto3), I get "ExpressionAttributeNames contains invalid key: Syntax error; key: <key name>"
I get a java.util.regex.PatternSyntaxException when splitting a string in PySpark
When it becomes Cannot import name "Feature" from "setuptools".
I get an error when trying meinheld + WebSocket + mongodb
When import matplotlib.pyplot cannot be done in pyenv-virtualenv environment
What to do when "cannot import name xxx" [Python]
When you get an error in python scraping (requests)
When I run pipenv install <package name>, I get a "No matching distribution found for <package name>" error.
When I try to connect to MySQL with mysql-connector-python, I cannot connect with the error "SSL connection error: SSL_CTX_set_tmp_dh failed"
When the variable name conflicts with the Devaga command in pdb
Format the Git log and get the committed file name in csv format
When changing the table name with flask_migrate
When I name the file flask.py in Flask, I get Import Error: cannot import name'Flask'
Handle CSV that contains the element you want to parse in the file name
Extract only the file name excluding the directory in the directory
Download the csv file created by Google Colaboratory
What! The unzipped file name was SJIS! command?
When reading a csv file with read_csv of pandas, the first column becomes index
Get the MIME type in Python and determine the file format
I get [Error 2055] when trying to connect to MySQL on Heroku
[Note] Import of a file in the parent directory in Python
Get the class name where the method is defined in the decorator
I got an error when I tried to process luigi in parallel on windows, but the solution
When I try to run the pip command after updating pip, I get "No such file or directory"
I get an OS Error: [Errno 8] Exec format error when running a Flask application with a python command
When I import my own module with VsCode, it says No name in module ... for some reason