"connect" is not a known member of module "aiosqlite"

Question:
I’m writing Discord bot on Disnake. I want make DataBase, but i get this error - ““connect” is not a known member of module “aiosqlite””

async def create_table(self):
      async with aiosqlite.connect(self.name) as db:
        cursor = await db.cursor()
        query = '''CREATE TABLE IF NOT EXISTS users (
          id INTEGER PRIMARY KEY,
          money INTEGER,
          premium INTEGER
        )'''
        await cursor.execute(query)
        await db.commit()
1 Like

Are you correctly importing aiosqlite?

import aiosqlite
1 Like

I’ve never worked with Disnake, but there are a few main possible issues to check (not to mention I’d need to see the rest of the code):

  1. Import statements - I’m assuming you’ve imported aiosqlite properly among other modules, as well as downloaded, but you should double check in case.
  2. Check if aiosqlite.connect even is a module.
import aiosqlite
from aiosqlite import connect

If it returns with connect is not a known member of aiosqulite, then either you are missing packages, it’s not an actual module, or connect is deeper down in the module (for this case check the reference code and see what additional imports are made, and import any of them related to aiosqlite)

Paste your code or a link to your repl for a better answer.

2 Likes

ofc, i’m importing aiosqlite correctly

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.