close

[Fixed] ImportError: No module named ‘mysql’

Today We are Going To Solve ImportError: No module named ‘mysql’ in Python. Here we will Discuss All Possible Solutions and How this error Occurs So let’s get started with this Article.

How to Fix ImportError: No module named ‘mysql’ Error?

  1. How to Fix ImportError: No module named ‘mysql’ Error?

    To Fix ImportError: No module named ‘mysql’ Error just Run the command. Jut use this command to solve your error: For python 3 pip3 install mysql-connector For python 2 pip install mysql-connector

  2. ImportError: No module named ‘mysql’

    To Fix ImportError: No module named ‘mysql’ Error just Use mysql-connector-python. Just run the below command to solve your error conda install -c anaconda mysql-connector-python

Solution 1 : Run the command

Jut use this command to solve your error:

For python 3

pip3 install mysql-connector

For python 2

pip install mysql-connector

Solution 2 : Use mysql-connector-python

Just run the below command to solve your error

conda install -c anaconda mysql-connector-python

Conclusion

So these were all possible solutions to this error. I hope your error has been solved by this article. In the comments, tell us which solution worked? If you liked our article, please share it on your social media and comment on your suggestions. Thank you.

Also Read This Solutions

Leave a Comment