Can't load sqlite:///chinook.db

Screen Link:

My Code:

import sqlalchemy as create_engine
import pandas as pd


What I expected to happen:
I’m new in this Python/SQL world, so apologies in advance if this is a very ridiculous question. I intend to load the chinook.db into my program in JupyterLab by using the code above but I’m constantly getting an error. I’ve downloaded the chinook.db file into my laptop and moved it to my Python folder from where I’m running the Jupyter program. Basically, I’m literally doing the same as a tutorial I found in YouTube, but it’s not working for me. I get this error:

What actually happened:

TypeError                                 Traceback (most recent call last)
<ipython-input-16-937205d18339> in <module>
----> 1 engine=create_engine('sqlite:///chinook.db')

TypeError: 'module' object is not callable

Not sure what’s going as I’m not an expert. Can anyone please assist? I can provide more info if needed

I would recommend going through the tutorial you are following in detail.

You are currently importing sqlalchemy as create_engine.

import sqlalchemy as create_engine

You are most likely required to import create_engine from sqlalchemy.

I was sure that I had a minor (and stupid) error in my coding, although I was unable to spot it. Thanks so much for your help!

1 Like