NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:mysql.pymysql

import pandas as pd
import numpy as np
from sqlalchemy import create_engine


sql = 'select * from products'
engine = create_engine('mysql+pymysql://root:passwd@localhost:3306/test_db?charset=utf8')
#engine = create_engine('mysql+pymysql://root:[email protected]:3306/test_db?charset=utf8')
#engine = create_engine("mysql://root:[email protected]:3306/test_db")
pd.read_sql(sql.engine)
Traceback (most recent call last):

  File "", line 1, in 
    runfile('C:/D/mypython/泰坦尼克/mysqlpd.py', wdir='C:/D/mypython/泰坦尼克')

  File "C:\D\anaconda\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 678, in runfile
    execfile(filename, namespace)

  File "C:\D\anaconda\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 106, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "C:/D/mypython/mysqlpd.py", line 10, in 
    engine = create_engine('mysql+pymysql://root:564179454@localhost:3306/test_db?charset=utf8')

  File "C:\D\anaconda\lib\site-packages\sqlalchemy\engine\__init__.py", line 387, in create_engine
    return strategy.create(*args, **kwargs)

  File "C:\D\anaconda\lib\site-packages\sqlalchemy\engine\strategies.py", line 56, in create
    entrypoint = u._get_entrypoint()

  File "C:\D\anaconda\lib\site-packages\sqlalchemy\engine\url.py", line 139, in _get_entrypoint
    cls = registry.load(name)

  File "C:\D\anaconda\lib\site-packages\sqlalchemy\util\langhelpers.py", line 218, in load
    (self.group, name))

NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:mysql.pymysql

搞不清哪里错了,先记下来吧

你可能感兴趣的:(报错)