Reputation: 4807
I am using the following code:
import pandas as pd, pyodbc
from sqlalchemy import create_engine
import urllib
def connStrMDBV2(fname):
driver = r'DRIVER={Microsoft Access Driver (*.mdb, *.accdb)}'
connection_string = (fr"{driver};DBQ={fname};ExtendedAnsiSQL=1;")
connection_uri = f"access+pyodbc:///?odbc_connect={urllib.parse.quote_plus(connection_string)}"
engine = create_engine(connection_uri)
return engine
fname = fr'C:\Users\asd\Desktop\test11\mytest.mdb'
connStrMDBV2(fname)
I get the error:
raise exc.NoSuchModuleError(
sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:access.pyodbc
I have checked all the packages are already installed and I am not using virtual environment. It used to work on Python 3.8 and I am getting error after upgrading to Python 3.11
Upvotes: 0
Views: 335