0

I am trying to import a package. And when it is imported, it seems to be working, i can use its elements, but, i get an error still that says that there i no package named after what i imported. the error is this:

from database import DataBase
 ModuleNotFoundError: No module named 'database'

I think people would try to suggest to do

pip install databases

in to the terminal, and i have done that, and i have also done these in to the terminal as well just incase:

pip install databases[postgresql]
pip install databases[mysql]
pip install databases[sqlite]

And it just does not seem to work.

Roald Andre Kvarv
  • 187
  • 1
  • 3
  • 21
  • 2
    Perhaps you're missing an "s" in ```from database import DataBase``` ? – bglbrt Nov 21 '19 at 11:33
  • You're installing a module named `databases`, then you're trying to import from a module named 'database`. Those are different names. – khelwood Nov 21 '19 at 11:35
  • @Tibbles the thing is, i am using pycharm, it comes up with the module name as that when i try and type it in. But ill try – Roald Andre Kvarv Nov 21 '19 at 11:36

1 Answers1

2

The following should work - note that Database is case sensitive. You can see the docs and some examples here.

from databases import Database
CDJB
  • 14,043
  • 5
  • 29
  • 55