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

Article author: Andrei Olegovich