Nixshnt
Nixshnt

Reputation: 41

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

I tried this:

pip install mysql-connector-python

It said that the requirement was satisfied.

Then I used:

pip install mysql-connector-python-rf

and got this error:

ERROR: Command errored out with exit status 1:
     command: 'c:\users\arush\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\arush\\AppData\\Local\\Temp\\pip-install-komi1sg9\\mysql-connector-python-rf\\setup.py'"'"'; __file__='"'"'C:\\Users\\arush\\AppData\\Local\\Temp\\pip-install-komi1sg9\\mysql-connector-python-rf\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, 
__file__, '"'"'exec'"'"'))' install --record 'C:\Users\arush\AppData\Local\Temp\pip-record-ov8jdz89\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\arush\appdata\local\programs\python\python37\Include\mysql-connector-python-rf'
         cwd: C:\Users\arush\AppData\Local\Temp\pip-install-komi1sg9\mysql-connector-python-rf\    
    Complete output (6 lines):
    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: setup.py --help [cmd1 cmd2 ...]
       or: setup.py --help-commands
appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\arush\\AppData\\Local\\Temp\\pip-install-komi1sg9\\mysql-connector-nizedpython-rf\\setup.py'"'"'; __file__='"'"'C:\\Users\\arush\\AppData\\Local\\Temp\\pip-install-komi1sg9\\mysql-connector-python-rappdata\local\programs\python\pythonf\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__fiv[0] = '"'"'C:\\Users\\arush\\AppDatle__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.clo\\setup.py'"'"'; __file__='"'"'C:\\Use();exec(compile(code, __file__, '"'"'exec'"'"'))' install --rconnector-python-rf\\setup.py'"'"';fecord 'C:\Users\arush\AppData\Local\Temp\pip-record-ov8jdz89\in).replace('"'"'\r\n'"'"', '"'"'\n'"'stall-record.txt' --single-version-externally-managed --compilestall --record 'C:\Users\arush\AppDa --install-headers 'c:\users\arush\appdata\local\programs\pythoversion-externally-managed --compilen\python37\Include\mysql-connector-python-rf' Check the logs fon\python37\Include\mysql-connector-pr full command output.

Upvotes: -1

Views: 1464

Answers (2)

Munish
Munish

Reputation: 45

Its hard to answer this question without getting some additional background information. For instance, are you windows? Is your pip updated? Did you install Python from anaconda? DO you have multiple versions of Python installed?

I would have thought a "requirement already satisfied" means you have the file install somewhere.

On Anaconda command prompt, you can type "conda list" to know exactly what you have installed already. Anaconda also has a useful GUI that lists exactly what is there as well

Upvotes: 1

Awitz
Awitz

Reputation: 306

You may be using python three instead. Try pip3 instead of pip when installing via the terminal

Upvotes: 1

Related Questions