Python can find a module…and then it can't

丶灬走出姿态 提交于 2019-11-28 14:37:08

In the traceback, I see that you named your file mysql.py. Therefore, when you try to import something from mysql.py, the interpreter looks for it in your own script, not the "actual" module. Instead of casting a wider net, it immediately gives up. To fix this, rename your script to something that doesn't mask any module names.

You have a mysql something or other either in your home directory, or in your new directory. It might be a .py file or perhaps the actual package (in the wrong place ;). Fix that and your problem should go away.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!