sqlalchemy.exc.NoSuchModuleError:无法加载插件:sqlalchemy.dialects:mysql

时间:2019-06-27 09:01:32

标签: python python-3.x sqlalchemy python-3.5

在python3而非python 2上运行时遇到此问题

我已经尝试过StackOverflow作为解决方案,但无法获得

from sqlalchemy import Column, Integer, String, Float, DateTime
from sqlalchemy.ext.declarative import declarative_base
import logging

from sqlalchemy.sql.sqltypes import CHAR

Base = declarative_base()

class remoteCommandTable(Base):
    """
    This table stores the command history of the table
    status :
       1 - Waiting for execution.
       2 - Sent to device,waiting for response
       3 - Recieved valid response from meter
       4 - Timeout
    """
    __tablename__ = "remote_command"

    transaction_id = Column(Integer, primary_key=True)
    req_timestamp = Column(DateTime)
    resp_timestamp = Column(DateTime)
    device_id = Column(Integer)
    device_type = Column(Integer)
    command = Column(String(50))
    response = Column(String(850))
    status = Column(Integer)



script restarted Thu Jun 27 14:28:32 2019
Traceback (most recent call last):
  File "broker.py", line 30, in <module>
    collection = dataCollector(client)
  File "/home/arnab/my practices/data/emot_data_aggregrator/data_collector.py", line 24, in __init__
    self.d_handler = dataCollectionDbHandler()
  File "/home/arnab/my practices/data/emot_data_aggregrator/database_handler.py", line 28, in __init__
    poolclass=StaticPool)
  File "/home/arnab/.local/lib/python3.5/site-packages/sqlalchemy/engine/__init__.py", line 423, in create_engine
    return strategy.create(*args, **kwargs)
  File "/home/arnab/.local/lib/python3.5/site-packages/sqlalchemy/engine/strategies.py", line 61, in create
    entrypoint = u._get_entrypoint()
  File "/home/arnab/.local/lib/python3.5/site-packages/sqlalchemy/engine/url.py", line 172, in _get_entrypoint
    cls = registry.load(name)
  File "/home/arnab/.local/lib/python3.5/site-packages/sqlalchemy/util/langhelpers.py", line 240, in load
    "Can't load plugin: %s:%s" % (self.group, name)
sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:mysql



关于sqlalchemy的错误是这样,根本没有尝试安装一些软件包,但仍然无法解决问题

import sqlalchemy
from sqlalchemy import Column, Integer, String, Float, DateTime
from sqlalchemy.ext.declarative import declarative_base
import logging

0 个答案:

没有答案