0

I was able to install Mysqldb with the pip install mysql-python command before(in Pycharm), but after installing Visual Code yesterday, it now gives an error. I did everything. I installed Visual Studio Build Tools, deleted and installed Python and Anaconda, but it still won't install. What should I do?

pip install mysql-python
Collecting mysql-python
  Using cached MySQL-python-1.2.5.zip (108 kB)
Building wheels for collected packages: mysql-python
  Building wheel for mysql-python (setup.py) ... \  WARNING: Subprocess output does not appear to be encoded as cp1254
error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\90539\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\90539\\AppData\\Local\\Temp\\pip-install-tn8inoxo\\mysql-python
\\setup.py'"'"'; __file__='"'"'C:\\Users\\90539\\AppData\\Local\\Temp\\pip-install-tn8inoxo\\mysql-python\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read
().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\90539\AppData\Local\Temp\pip-wheel-dk9sq9jv'
       cwd: C:\Users\90539\AppData\Local\Temp\pip-install-tn8inoxo\mysql-python\
  Complete output (33 lines):
  C:\Users\90539\Anaconda3\lib\site-packages\setuptools\dist.py:669: UserWarning: Usage of dash-separated 'distribution-name' will not be supported in future versions. Please use the u
nderscore name 'distribution_name' instead
    warnings.warn(
  C:\Users\90539\Anaconda3\lib\site-packages\setuptools\dist.py:669: UserWarning: Usage of dash-separated 'build-requires' will not be supported in future versions. Please use the unde
rscore name 'build_requires' instead
    warnings.warn(
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.8
  copying _mysql_exceptions.py -> build\lib.win-amd64-3.8
  creating build\lib.win-amd64-3.8\MySQLdb
  copying MySQLdb\__init__.py -> build\lib.win-amd64-3.8\MySQLdb
  copying MySQLdb\converters.py -> build\lib.win-amd64-3.8\MySQLdb
  copying MySQLdb\connections.py -> build\lib.win-amd64-3.8\MySQLdb
  copying MySQLdb\cursors.py -> build\lib.win-amd64-3.8\MySQLdb
  copying MySQLdb\release.py -> build\lib.win-amd64-3.8\MySQLdb
  copying MySQLdb\times.py -> build\lib.win-amd64-3.8\MySQLdb
  creating build\lib.win-amd64-3.8\MySQLdb\constants
  copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.8\MySQLdb\constants
  copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.8\MySQLdb\constants
  copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.8\MySQLdb\constants
  copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.8\MySQLdb\constants
  copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.8\MySQLdb\constants
  copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-3.8\MySQLdb\constants
  copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.8\MySQLdb\constants
  running build_ext
  building '_mysql' extension
  creating build\temp.win-amd64-3.8
  creating build\temp.win-amd64-3.8\Release
  C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(1,2,5,'final',1) -
D__version__=1.2.5 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" -IC:\Users\90539\Anaconda3\include -IC:\Users\90539\Anaconda3\include "-IC:\Program Files (x86)\Micr
osoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\in
clude\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files
(x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tc_mysql.c /Fobuild\temp.win-amd64-3.8\Release\_mysql.obj /Zl
  _mysql.c
  _mysql.c(42): fatal error C1083: i‡erme dosyas\x8d a‡\x8dlam\x8dyor: 'config-win.h': No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29910\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
  ----------------------------------------
  ERROR: Failed building wheel for mysql-python
  Running setup.py clean for mysql-python
Failed to build mysql-python
Installing collected packages: mysql-python
    Running setup.py install for mysql-python ... /    WARNING: Subprocess output does not appear to be encoded as cp1254
error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\90539\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\90539\\AppData\\Local\\Temp\\pip-install-tn8inoxo\\mysql-pyth
on\\setup.py'"'"'; __file__='"'"'C:\\Users\\90539\\AppData\\Local\\Temp\\pip-install-tn8inoxo\\mysql-python\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.re
ad().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\90539\AppData\Local\Temp\pip-record-ac858le3\install-reco
rd.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\90539\Anaconda3\Include\mysql-python'
         cwd: C:\Users\90539\AppData\Local\Temp\pip-install-tn8inoxo\mysql-python\
    Complete output (33 lines):
    C:\Users\90539\Anaconda3\lib\site-packages\setuptools\dist.py:669: UserWarning: Usage of dash-separated 'distribution-name' will not be supported in future versions. Please use the
 underscore name 'distribution_name' instead
      warnings.warn(
    C:\Users\90539\Anaconda3\lib\site-packages\setuptools\dist.py:669: UserWarning: Usage of dash-separated 'build-requires' will not be supported in future versions. Please use the un
derscore name 'build_requires' instead
      warnings.warn(
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.8
    copying _mysql_exceptions.py -> build\lib.win-amd64-3.8
    creating build\lib.win-amd64-3.8\MySQLdb
    copying MySQLdb\__init__.py -> build\lib.win-amd64-3.8\MySQLdb
    copying MySQLdb\converters.py -> build\lib.win-amd64-3.8\MySQLdb
    copying MySQLdb\connections.py -> build\lib.win-amd64-3.8\MySQLdb
    copying MySQLdb\cursors.py -> build\lib.win-amd64-3.8\MySQLdb
    copying MySQLdb\release.py -> build\lib.win-amd64-3.8\MySQLdb
    copying MySQLdb\times.py -> build\lib.win-amd64-3.8\MySQLdb
    creating build\lib.win-amd64-3.8\MySQLdb\constants
    copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.8\MySQLdb\constants
    copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.8\MySQLdb\constants
    copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.8\MySQLdb\constants
    copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.8\MySQLdb\constants
    copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.8\MySQLdb\constants
    copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-3.8\MySQLdb\constants
    copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.8\MySQLdb\constants
    running build_ext
    building '_mysql' extension
    creating build\temp.win-amd64-3.8
    creating build\temp.win-amd64-3.8\Release
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(1,2,5,'final',1)
 -D__version__=1.2.5 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" -IC:\Users\90539\Anaconda3\include -IC:\Users\90539\Anaconda3\include "-IC:\Program Files (x86)\Mi
crosoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\
include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program File
s (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tc_mysql.c /Fobuild\temp.win-amd64-3.8\Release\_mysql.obj /Zl
    _mysql.c
    _mysql.c(42): fatal error C1083: i‡erme dosyas\x8d a‡\x8dlam\x8dyor: 'config-win.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29910\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\90539\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\90539\\AppData\\Local\\Temp\
\pip-install-tn8inoxo\\mysql-python\\setup.py'"'"'; __file__='"'"'C:\\Users\\90539\\AppData\\Local\\Temp\\pip-install-tn8inoxo\\mysql-python\\setup.py'"'"';f=getattr(tokenize, '"'"'ope
n'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\90539\AppData\Local\Temp
\pip-record-ac858le3\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\90539\Anaconda3\Include\mysql-python' Check the logs for full command
 output.
3
  • Why only provide pictures which contain text (and not simply copy paste the text directly into your question ? Commented May 8, 2021 at 11:07
  • Why do you provide only the error messages, and not the action that you where performing? Commented May 8, 2021 at 11:08
  • Sorry @Luuk, I update the question. Commented May 8, 2021 at 11:35

1 Answer 1

1

Is it possible that your python version changed from 2.7 to some 3.x version? See the package documentation here, it reads:

MySQL-3.23 through 5.5 and Python-2.4 through 2.7 are currently supported. Python-3.0 will be supported in a future release. PyPy is supported.

If you are now on 3.x try pip install mysqlclient.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.