ImportError: No module named mysql.connector using Python2

前端 未结 12 2081
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-13 06:26

I have two files. The first one has the connection and the getting of data. I import mysql.connector. This file is called tasksSql.py

def get_users():
    im         


        
12条回答
  •  星月不相逢
    2020-12-13 07:00

    I had problem with my MySQL installation, I was given this error:

     import mysql.connector ModuleNotFoundError: No module named 'mysql' (zrealestate) 
    [root@localhost zrealestate]# brew install mysql
    -bash: brew: command not found
    

    But I resolved it with this:

    pip install mysql-connector-python
    

提交回复
热议问题