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.
Contents
How to Fix ImportError: No module named ‘mysql’ Error?
- 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 2pip install mysql-connector
- 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
- Execution failed for task ‘:app:checkDebugAarMetadata’
- Could not install packages due to an EnvironmentError: [Errno 13] Permission denied
- ImportError: libGL.so.1: cannot open shared object file: No such file or directory
- WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead
- ModuleNotFoundError: No module named ‘utils’