Я работаю над кодом из CS50 Beyond ... онлайн-курс доступен на YouTube. Проф. Брайан Ю Этот код взят из лекции ORM и API для моделей . py file.
Я не понимаю эту ошибку
(venv) (base) pglab@pglab15:~/Downloads/Compressed/orms_and_apis/airline2$ export FLASK_APP=application.py
(venv) (base) pglab@pglab15:~/Downloads/Compressed/orms_and_apis/airline2$ python3.7 application.py
(venv) (base) pglab@pglab15:~/Downloads/Compressed/orms_and_apis/airline2$ flask run
* Serving Flask app "application.py"
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
Usage: flask run [OPTIONS]
Error: While importing "application", an ImportError was raised:
Traceback (most recent call last):
File "/home/pglab/venv/lib/python3.7/site-packages/flask/cli.py", line 240, in locate_app
__import__(module_name)
File "/home/pglab/Downloads/Compressed/orms_and_apis/airline2/application.py", line 2, in <module>
from models import *
File "/home/pglab/Downloads/Compressed/orms_and_apis/airline2/models.py", line 4, in <module>
from flask_sqlalchemy import SQLAlchemy
ModuleNotFoundError: No module named 'flask_sqlalchemy'
Я также проверяю все настройки,
(venv) (base) pglab@pglab15:~/Downloads/Compressed/orms_and_apis/airline2$ python3.7 -m flask --version
Python 3.7.4
Flask 1.1.1
Werkzeug 0.16.0
(venv) (base) pglab@pglab15:~/Downloads/Compressed/orms_and_apis/airline2$ pip install Flask
Requirement already satisfied: Flask in /home/pglab/venv/lib/python3.7/site-packages (1.1.1)
(venv) (base) pglab@pglab15:~/Downloads/Compressed/orms_and_apis/airline2$ python3 -m pip install sqlalchemy
Requirement already satisfied: sqlalchemy in /home/pglab/venv/lib/python3.7/site-packages (1.3.13)
Все вроде нормально! Я запускаю свое приложение flask много раз, но когда я запускаю программы ORM в flask, все становится грязно ...
Может кто-нибудь помочь мне!