'Why does 'Flask' show up in the package list but we use 'from flask import Flask'?

I'm new to python, so I apologize if I'm asking naive questions.

When I use pip freeze to check the package list, I see:

  • Flask
  • Flask-SQLAlchemy

However, in the python script, we write:

from flask import Flask
from flask_sqlalchemy import SQLAlchemy

I feel confused about the change in the capitalization (why simply import Flask does not work?) and the dash becoming an underscore. As there are other packages that are in all-lowercase, I guess it is a convention when a package name contains upper cases or dashes. Is it correct?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source