Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with pip install MySQL-python on Windows #160

Open
cpdivers opened this issue Sep 7, 2023 · 0 comments
Open

Issue with pip install MySQL-python on Windows #160

cpdivers opened this issue Sep 7, 2023 · 0 comments

Comments

@cpdivers
Copy link

cpdivers commented Sep 7, 2023

OS: Windows 11
Python: Python 3.11.5

`pip install MySQL-python

Collecting MySQL-python
Using cached MySQL-python-1.2.5.zip (108 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: MySQL-python
Building wheel for MySQL-python (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for MySQL-python (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [59 lines of output]
C:\Users\Personne\AppData\Local\Temp\pip-build-env-mth1jh66\overlay\Lib\site-packages\setuptools\dist.py:510: SetuptoolsDeprecationWarning: Invalid dash-separated options
!!

          ********************************************************************************
          Usage of dash-separated 'distribution-name' will not be supported in future
          versions. Please use the underscore name 'distribution_name' instead.

          By 2023-Sep-26, you need to update your project and remove deprecated calls
          or your builds will no longer be supported.

          See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
          ********************************************************************************

  !!
    opt = self.warn_dash_deprecation(opt, section)
  C:\Users\Personne\AppData\Local\Temp\pip-build-env-mth1jh66\overlay\Lib\site-packages\setuptools\dist.py:510: SetuptoolsDeprecationWarning: Invalid dash-separated options
  !!

          ********************************************************************************
          Usage of dash-separated 'build-requires' will not be supported in future
          versions. Please use the underscore name 'build_requires' instead.

          By 2023-Sep-26, you need to update your project and remove deprecated calls
          or your builds will no longer be supported.

          See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
          ********************************************************************************

  !!
    opt = self.warn_dash_deprecation(opt, section)
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-cpython-311
  copying _mysql_exceptions.py -> build\lib.win-amd64-cpython-311
  creating build\lib.win-amd64-cpython-311\MySQLdb
  copying MySQLdb\__init__.py -> build\lib.win-amd64-cpython-311\MySQLdb
  copying MySQLdb\converters.py -> build\lib.win-amd64-cpython-311\MySQLdb
  copying MySQLdb\connections.py -> build\lib.win-amd64-cpython-311\MySQLdb
  copying MySQLdb\cursors.py -> build\lib.win-amd64-cpython-311\MySQLdb
  copying MySQLdb\release.py -> build\lib.win-amd64-cpython-311\MySQLdb
  copying MySQLdb\times.py -> build\lib.win-amd64-cpython-311\MySQLdb
  creating build\lib.win-amd64-cpython-311\MySQLdb\constants
  copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-cpython-311\MySQLdb\constants
  copying MySQLdb\constants\CR.py -> build\lib.win-amd64-cpython-311\MySQLdb\constants
  copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-cpython-311\MySQLdb\constants
  copying MySQLdb\constants\ER.py -> build\lib.win-amd64-cpython-311\MySQLdb\constants
  copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-cpython-311\MySQLdb\constants
  copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-cpython-311\MySQLdb\constants
  copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-cpython-311\MySQLdb\constants
  running build_ext
  building '_mysql' extension
  creating build\temp.win-amd64-cpython-311
  creating build\temp.win-amd64-cpython-311\Release
  "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\bin\HostX86\x64\cl.exe" /c /nologo /O2 /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" -Id:\scripts\python\lego-inventory-2\venv\include -IC:\Users\Personne\AppData\Local\Programs\Python\Python311\include -IC:\Users\Personne\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tc_mysql.c /Fobuild\temp.win-amd64-cpython-311\Release\_mysql.obj /Zl
  _mysql.c
  _mysql.c(42): fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.37.32822\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for MySQL-python
Failed to build MySQL-python
ERROR: Could not build wheels for MySQL-python, which is required to install pyproject.toml-based projects
`

First issue: I believe it is quite bad to hard code a path to a compiler
Second issue: Cannot open include file: 'config-win.h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant