OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

in python mysql.connector why i see the this Errors?

  • Thread starter Thread starter Mohamed Abd El Ghafar
  • Start date Start date

Mohamed Abd El Ghafar

I am a new user for python

import mysql.connector


conn = mysql.connector.connect(






mycur.execute('creat database rakwan')

except mysql.connector.Error as r:


the Error is:-

PS C:\\Users\\computer 8\> & "C:/Users/computer 8/AppData/Local/Programs/Python/Python312/python.exe" e:/PROGRAMING/python/Racoon/Learn/mq.py

Traceback (most recent call last):

File "e:\\PROGRAMING\\python\\Racoon\\Learn\\mq.py", line 1, in \<module\>

import mysql.connector

File "e:\\PROGRAMING\\python\\Racoon\\Learn\\mysql.py", line 1, in \<module\>

import mysql.connector

ModuleNotFoundError: No module named 'mysql.connector'; 'mysql' is not a package

pip install mysql

pip install mysql-connector

pip install mysql-connector-python-rf
<p>I am a new user for python</p>
<p>import mysql.connector</p>
<p>conn = mysql.connector.connect(</p>
<p>mycur.execute('creat database rakwan')</p>
<p>except mysql.connector.Error as r:</p>
<p>the Error is:-</p>
<p>PS C:\\Users\\computer 8\> & "C:/Users/computer 8/AppData/Local/Programs/Python/Python312/python.exe" e:/PROGRAMING/python/Racoon/Learn/mq.py</p>
<p>Traceback (most recent call last):</p>
<p>File "e:\\PROGRAMING\\python\\Racoon\\Learn\\mq.py", line 1, in \<module\></p>
<p>import mysql.connector</p>
<p>File "e:\\PROGRAMING\\python\\Racoon\\Learn\\mysql.py", line 1, in \<module\></p>
<p>import mysql.connector</p>
<p>ModuleNotFoundError: No module named 'mysql.connector'; 'mysql' is not a package</p>
<p>pip install mysql</p>
<p>pip install mysql-connector</p>
<p>pip install mysql-connector-python-rf</p>

Latest posts