zoukankan      html  css  js  c++  java
  • python:使用SQLAlchemy初始化mysql数据库报错 No module named 'mysql'

    RoamEdit 感兴趣的可以点击下面的连接进行注册 -
    邀请码:ycgca02
    RoamEdit是国内首款双向链接大纲工具,它能轻松地将你的知识建成一个知识网络,学过的知识很容易就能被应用起来 https://roamedit.com/?invite=ycgca02

    Traceback (most recent call last):
      File "D:projectsPythonSQLAlchemy01-demo.py", line 19, in <module>
        engine = create_engine('mysql+mysqlconnector://root:123456@localhost:3306/demo')
      File "D:PythonPython39libsite-packagessqlalchemyengine\__init__.py", line 520, in create_engine
        return strategy.create(*args, **kwargs)
      File "D:PythonPython39libsite-packagessqlalchemyenginestrategies.py", line 87, in create
        dbapi = dialect_cls.dbapi(**dbapi_args)
      File "D:PythonPython39libsite-packagessqlalchemydialectsmysqlmysqlconnector.py", line 135, in dbapi
        from mysql import connector
    ModuleNotFoundError: No module named 'mysql'
    

    解决方法

    pip install mysql-connector
    
  • 相关阅读:
    SpringBoot项目设置maven打包时间
    SpringBoot热部署配置
    Git笔记
    SpringBoot LogBack日志配置
    CURL使用教程
    Linux 安装Docker及使用
    转发和重定向的区别
    16周作业
    16
    15周
  • 原文地址:https://www.cnblogs.com/wbyixx/p/14484481.html
Copyright © 2011-2022 走看看