Errors Flask

Errors Flask

Flask Logo

ImportError: cannot import name 'Flask' from partially initialized module

ImportError: cannot import name 'Flask' from partially initialized module 'flask' (most likely due to a circular import)

This error occurs if you named your file flask.py. Rename it to something else - for example app.py

FileNotFoundError: [Errno 2] No such file or directory:

FileNotFoundError: [Errno 2] No such file or directory:

This error occurs, for example, if you want to open a file in the same directory as the script on Windows, and you think that you can simply write open('file_name')

Maybe in some places this works, but I had to specify the full path to the file.

with open('C:\Users\Andrei\PycharmProjects\aredel_com\aredel_com_venv\aredel.json','r') as f:

UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 69:

UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 69: character maps to <undefined>

Most likely your file contains Russian text, and support for the Russian language is not enabled.

ModuleNotFoundError: No module named 'flaskr.flaskr'

ModuleNotFoundError: No module named 'flaskr.flaskr'

Most likely you are trying to run flask following the instructions from the official tutorial, but you are doing it from the wrong directory.

You need to return to the root directory flask-tutorial and run flask run in it

↓ Articles about Flask ↓
Python
Flask
Running Flask on hosting
Running Flask on a Linux server
The first Flask project
Jinja templates
Flask FAQ
Web Forms
Errors
↓ Python articles ↓
Development in Python
Interactive mode
Virtual environment
str: strings
\: line break
Lists
Loops
Methods
Functions
*args **kwargs
enum
Determine a Python variable type
Testing with Python
Working with REST API in Python
Files: write, read, append, context manager…
Download a file over the network
SQLite3: working with a database
datetime: Date and Time in Python
Selenium + Python
Difficulties when working with Python
DJANGO
Flask
Script for a ZPL printer
socket :Python Sockets
subprocess: run bash commands from Python
multiprocessing: several processes at once
psutil: system resources
sys.argv: command line arguments
PyCharm: IDE
pydantic: data validation
paramiko: SSH from Python
enumerate
json.dumps

Article author: Andrei Olegovich