• 欢迎访问显哥博客,本网站纯属学习技术,绝无商业用途,欢迎小伙伴们共同学习!研究技术!QQ:52249909 加我QQ
  • 世界75亿人,这么小的概率,能认识你,是我一生的幸运,不妨加个QQ接触一下:52249909 加我QQ

Mysqldb不兼容Python3.5 以后的版本 报错NameError: name ‘_mysql’ is not defined【显哥出品,必为精品】

Python开发 lixian 2年前 (2023-02-22) 12439次浏览 98个评论 扫描二维码
文章目录[隐藏]

Mysqldb不兼容Python3.5 以后的版本 报错NameError: name '_mysql' is not defined【显哥出品,必为精品】

解决办法:

1、打开环境下Python\Lib\site-packages\MySQLdb\release.py 、查看mysqlclient的版本

Mysqldb不兼容Python3.5 以后的版本 报错NameError: name '_mysql' is not defined【显哥出品,必为精品】

2、在项目下的init.py文件内,加上如下代码(注意是在自己的项目内):

import pymysql

pymysql.version_info = (1,4,6,'final',0)

pymysql.install_as_MySQLdb()

本站博主 , 版权所有丨如未注明 , 均为原创
转载请注明原文链接:Mysqldb不兼容Python3.5 以后的版本 报错NameError: name ‘_mysql’ is not defined【显哥出品,必为精品】
喜欢 (1)

您必须 登录 才能发表评论!

(98)个小伙伴在吐槽
  1. you can contact us for the cheapest influencer advertising services.
  2. I very delighted to find this internet site on bing, just what I was searching for as well saved to fav
  3. I very delighted to find this internet site on bing, just what I was searching for as well saved to fav
  4. everything, including cryptocurrency, is just a click away here.
  5. ucuz takipçi satın al
  6. Awesome! Its genuinely remarkable post, I have got much clear idea regarding from this post
  7. en uygun takipçi satın al
    postegro2023-04-03 07:52
  8. instagram takipçi satın al
  9. takipçi satın aldım süper
  10. the world of crypto money
  11. Hackdra is a cyber security company that can provide smart contract auditing, pen-testing, bug bounty, blockchain, web3, and ARM services with AI.
    hackdra2023-03-14 23:29
  12. Social Media Panel
    smm paneli2023-03-14 09:04
  13. We are dedicated to serving a wide range of users, from 7 to 70, who care about their body and beauty.
  14. How to find love ?
    disfruto2023-03-12 04:14
  15. Rising up on social media is just a click away from you.
    smm paneli2023-03-11 19:54
  16. I truly appreciate your technique of writing a blog. I added it to my bookmark site list and will
  17. This is really interesting, You’re a very skilled blogger. I’ve joined your feed and look forward to seeking more of your magnificent post. Also, I’ve shared your site in my social networks!
  18. I very delighted to find this internet site on bing, just what I was searching for as well saved to fav
  19. Hi there to all, for the reason that I am genuinely keen of reading this website’s post to be updated on a regular basis. It carries pleasant stuff.
  20. very informative articles or reviews at this time.
1235