Python 3 mySQL.connector frozen import lib

前端 未结 1 814
我在风中等你
我在风中等你 2021-01-23 20:06

I am new to Python 3 and still learning but I need help. The first part of the script is:

import mysql.connector #this is failing as a .py but works in the shell<

相关标签:
1条回答
  • 2021-01-23 20:46

    I have the same question as your, and I found an answer in another website where you asked the same question. I'm pasting the answer here as reference.

    The above happens because your script is named 'mysql.py', which is actually the same name as the 'mysql' package. Python correctly reports ImportError. Simply rename your 'mysql.py' to something else, like 'mysqlhacks.py'.

    Taken from https://answers.launchpad.net/myconnpy/+question/226992

    0 讨论(0)
提交回复
热议问题