modulenotfounderror no module named 'mysqldb' python 3

modulenotfounderror no module named 'mysqldb' python 3

Hi,

I have a python program and it is connecting to MySQL database.

But it throws following error:

modulenotfounderror no module named 'mysqldb' python 3

How to resolve this?

Thanks

View Answers

February 20, 2018 at 10:41 AM

HI,

This error is coming because mysqldb library is not installed on your python.

Error:

ModuleNotFoundError: No module named 'MySQLdb'

You can run mysqldb with following command to resolve this:

conda install MySQL-python

or

pip install MySQL-python

Thanks


February 20, 2018 at 10:43 AM

HI,

Here is the installation process output:

(tensorflow) D:\ClientServers\dermot\2018>conda install MySQL-python
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.4.8
  latest version: 4.4.10

Please update conda by running

    $ conda update -n base conda



## Package Plan ##

  environment location: C:\Users\user\AppData\Local\conda\conda\envs\tensorflow

  added / updated specs:
    - mysql-python


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    mysql-python-1.2.5         |           py27_0         764 KB
    certifi-2018.1.18          |           py27_0         144 KB
    setuptools-38.4.0          |           py27_0         541 KB
    pip-9.0.1                  |   py27hdaa76b4_4         2.4 MB
    wincertstore-0.2           |   py27hf04cefb_0          13 KB
    vc-9                       |       h7299396_1           3 KB
    vs2008_runtime-9.00.30729.1|       hfaea7d5_1        1017 KB
    python-2.7.14              |      h8c3f1cb_23        20.6 MB
    wheel-0.30.0               |   py27ha643586_1          84 KB
    ------------------------------------------------------------
                                           Total:        25.4 MB

The following NEW packages will be INSTALLED:

    mysql-python:   1.2.5-py27_0
    vs2008_runtime: 9.00.30729.1-hfaea7d5_1

The following packages will be UPDATED:

    certifi:        2017.7.27.1-py35hbab57cd_0 --> 2018.1.18-py27_0
    pip:            9.0.1-py35h691316f_4       --> 9.0.1-py27hdaa76b4_4
    setuptools:     36.5.0-py35h21a22e4_0      --> 38.4.0-py27_0
    wheel:          0.29.0-py35hdbcb6e6_1      --> 0.30.0-py27ha643586_1
    wincertstore:   0.2-py35hfebbdb8_0         --> 0.2-py27hf04cefb_0

The following packages will be DOWNGRADED:

    python:         3.5.4-hc495aa9_21          --> 2.7.14-h8c3f1cb_23
    vc:             14-h2379b0c_2              --> 9-h7299396_1

Proceed ([y]/n)? y


Downloading and Extracting Packages
mysql-python 1.2.5: ################################################### | 100%
certifi 2018.1.18: #################################################### | 100%
setuptools 38.4.0: #################################################### | 100%
pip 9.0.1: ############################################################ | 100%
wincertstore 0.2: ##################################################### | 100%
vc 9: ################################################################# | 100%
vs2008_runtime 9.00.30729.1: ########################################## | 100%
python 2.7.14: ######################################################## | 100%
wheel 0.30.0: ######################################################### | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

Thanks

Ads









Related Tutorials/Questions & Answers:
modulenotfounderror no module named 'mysqldb' python 3
modulenotfounderror no module named 'mysqldb' python 3  Hi, I have... error: modulenotfounderror no module named 'mysqldb' python 3 How to resolve... is not installed on your python. Error: ModuleNotFoundError: No module named
modulenotfounderror no module named 'mysqldb' python 3
modulenotfounderror no module named 'mysqldb' python 3  Hi, I have... error: modulenotfounderror no module named 'mysqldb' python 3 How to resolve... is not installed on your python. Error: ModuleNotFoundError: No module named
Advertisements
ModuleNotFoundError: No module named 'MySQLdb'
ModuleNotFoundError: No module named 'MySQLdb'  Hi, My Python... 'MySQLdb' How to remove the ModuleNotFoundError: No module named 'MySQLdb..., ModuleNotFoundError: No module named 'MySQLdb' error will be solved
ModuleNotFoundError: No module named 'mysqldb-wrapper'
ModuleNotFoundError: No module named 'mysqldb-wrapper'  Hi, My... named 'mysqldb-wrapper' How to remove the ModuleNotFoundError: No module named... the installation of mysqldb-wrapper python library, ModuleNotFoundError: No module
ModuleNotFoundError: No module named 'Flask-MySQLdb'
the installation of Flask-MySQLdb python library, ModuleNotFoundError: No module named '...ModuleNotFoundError: No module named 'Flask-MySQLdb'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'mysqldb-rich'
ModuleNotFoundError: No module named 'mysqldb-rich'  Hi, My Python... of mysqldb-rich python library, ModuleNotFoundError: No module named '... 'mysqldb-rich' How to remove the ModuleNotFoundError: No module named '
ModuleNotFoundError: No module named '3'
ModuleNotFoundError: No module named '3'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named '3' How to remove the ModuleNotFoundError: No module named '3' error
pip install dateutil python 3
pip install dateutil python 3  Hi, How to use the pip util to install dateutil python 3? I have Python3 and on this python I have to install the dateutil package. Thanks
conda create environment python 3
conda create environment python 3  Hi, I have Anaconda installed and i have to create virtual environment for python 3. How I can create my new Python 3 virtual environment? I need example of conda create environment python 3
ModuleNotFoundError: No module named 'Python'
ModuleNotFoundError: No module named 'Python'  Hi, My Python... 'Python' How to remove the ModuleNotFoundError: No module named 'Python'..., ModuleNotFoundError: No module named 'Python' error will be solved. Thanks
ModuleNotFoundError: No module named 'Python'
ModuleNotFoundError: No module named 'Python'  Hi, My Python... 'Python' How to remove the ModuleNotFoundError: No module named 'Python'..., ModuleNotFoundError: No module named 'Python' error will be solved. Thanks
ModuleNotFoundError: No module named 'python-at'
ModuleNotFoundError: No module named 'python-at'  Hi, My Python... 'python-at' How to remove the ModuleNotFoundError: No module named 'python...-at python library, ModuleNotFoundError: No module named 'python-at' error
NameError: global name 'xrange' is not defined in Python 3
NameError: global name 'xrange' is not defined in Python 3  Hi, I am running a program in Python 3 and its throwing following error: NameError: global name 'xrange' is not defined in Python 3 How to solve NameError: global
NameError: global name 'xrange' is not defined in Python 3
NameError: global name 'xrange' is not defined in Python 3  Hi, I am running a program in Python 3 and its throwing following error: NameError: global name 'xrange' is not defined in Python 3 How to solve NameError: global
ModuleNotFoundError: No module named 'libvslvm-python'
ModuleNotFoundError: No module named 'libvslvm-python'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'libvslvm-python' How to remove the ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'python_constantcontact'
ModuleNotFoundError: No module named 'python_constantcontact'  Hi...: No module named 'python_constantcontact' How to remove the ModuleNotFoundError... library, ModuleNotFoundError: No module named 'python_constantcontact'
ModuleNotFoundError: No module named 'python-codicefiscale'
ModuleNotFoundError: No module named 'python-codicefiscale'  Hi...: No module named 'python-codicefiscale' How to remove the ModuleNotFoundError..., ModuleNotFoundError: No module named 'python-codicefiscale' error
ModuleNotFoundError: No module named 'python-emailvision'
ModuleNotFoundError: No module named 'python-emailvision'  Hi, My... named 'python-emailvision' How to remove the ModuleNotFoundError: No module..., ModuleNotFoundError: No module named 'python-emailvision' error will be solved
ModuleNotFoundError: No module named 'python-emites'
ModuleNotFoundError: No module named 'python-emites'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'python-emites' How to remove the ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'python-engineering'
ModuleNotFoundError: No module named 'python-engineering'  Hi, My... named 'python-engineering' How to remove the ModuleNotFoundError: No module..., ModuleNotFoundError: No module named 'python-engineering' error will be solved
ModuleNotFoundError: No module named 'python-fanart'
ModuleNotFoundError: No module named 'python-fanart'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'python-fanart' How to remove the ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'python-fastpip'
ModuleNotFoundError: No module named 'python-fastpip'  Hi, My... named 'python-fastpip' How to remove the ModuleNotFoundError: No module named... the installation of python-fastpip python library, ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'python-fcc'
ModuleNotFoundError: No module named 'python-fcc'  Hi, My Python... 'python-fcc' How to remove the ModuleNotFoundError: No module named '...-fcc python library, ModuleNotFoundError: No module named 'python-fcc'
ModuleNotFoundError: No module named 'python-fedora'
ModuleNotFoundError: No module named 'python-fedora'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'python-fedora' How to remove the ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'Python-For-Excel'
ModuleNotFoundError: No module named 'Python-For-Excel'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'Python-For-Excel' How to remove the ModuleNotFoundError: No module
ModuleNotFoundError: No module named 'python-forge'
ModuleNotFoundError: No module named 'python-forge'  Hi, My Python... 'python-forge' How to remove the ModuleNotFoundError: No module named '... of python-forge python library, ModuleNotFoundError: No module named 'python
ModuleNotFoundError: No module named 'python-form'
ModuleNotFoundError: No module named 'python-form'  Hi, My Python... 'python-form' How to remove the ModuleNotFoundError: No module named '... of python-form python library, ModuleNotFoundError: No module named 'python-form
ModuleNotFoundError: No module named 'python-geoip'
ModuleNotFoundError: No module named 'python-geoip'  Hi, My Python... 'python-geoip' How to remove the ModuleNotFoundError: No module named '... of python-geoip python library, ModuleNotFoundError: No module named 'python
ModuleNotFoundError: No module named 'python-gsasl'
ModuleNotFoundError: No module named 'python-gsasl'  Hi, My Python... 'python-gsasl' How to remove the ModuleNotFoundError: No module named '... of python-gsasl python library, ModuleNotFoundError: No module named 'python
ModuleNotFoundError: No module named 'python-gtbmm'
ModuleNotFoundError: No module named 'python-gtbmm'  Hi, My Python... 'python-gtbmm' How to remove the ModuleNotFoundError: No module named '... of python-gtbmm python library, ModuleNotFoundError: No module named 'python
ModuleNotFoundError: No module named 'python-intensifies'
ModuleNotFoundError: No module named 'python-intensifies'  Hi, My... named 'python-intensifies' How to remove the ModuleNotFoundError: No module..., ModuleNotFoundError: No module named 'python-intensifies' error will be solved

Ads