While doing pip install SPAMS, I encountered the following error:
(base) C:\Users\Foram>pip install spams
Collecting spams
Using cached spams-2.6.5.4.tar.gz (2.0 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: Pillow>=6.0 in c:\users\foram\anaconda3\lib\site-packages (from spams) (8.0.1)
Requirement already satisfied: scipy>=1.0 in c:\users\foram\appdata\roaming\python\python38\site-packages (from spams) (1.4.1)
Requirement already satisfied: numpy>=1.12 in c:\users\foram\anaconda3\lib\site-packages (from spams) (1.21.2)
Building wheels for collected packages: spams
Building wheel for spams (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for spams (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [29 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-38
creating build\lib.win-amd64-cpython-38\spams_wrap
copying spams_wrap\spams_wrap.py -> build\lib.win-amd64-cpython-38\spams_wrap
copying spams_wrap\__init__.py -> build\lib.win-amd64-cpython-38\spams_wrap
creating build\lib.win-amd64-cpython-38\spams
copying spams\spams.py -> build\lib.win-amd64-cpython-38\spams
copying spams\__init__.py -> build\lib.win-amd64-cpython-38\spams
creating build\lib.win-amd64-cpython-38\spams\tests
copying spams\tests\run.py -> build\lib.win-amd64-cpython-38\spams\tests
copying spams\tests\test_decomp.py -> build\lib.win-amd64-cpython-38\spams\tests
copying spams\tests\test_dictLearn.py -> build\lib.win-amd64-cpython-38\spams\tests
copying spams\tests\test_linalg.py -> build\lib.win-amd64-cpython-38\spams\tests
copying spams\tests\test_prox.py -> build\lib.win-amd64-cpython-38\spams\tests
copying spams\tests\test_spams.py -> build\lib.win-amd64-cpython-38\spams\tests
copying spams\tests\test_utils.py -> build\lib.win-amd64-cpython-38\spams\tests
copying spams\tests\__init__.py -> build\lib.win-amd64-cpython-38\spams\tests
creating build\lib.win-amd64-cpython-38\spams\data
copying spams\data\boat.png -> build\lib.win-amd64-cpython-38\spams\data
copying spams\data\lena.png -> build\lib.win-amd64-cpython-38\spams\data
copying spams\version -> build\lib.win-amd64-cpython-38\spams
running build_ext
cl : Command line error D8021 : invalid numeric argument '/Wunused-variable'
C:\Users\Foram\AppData\Local\Temp\pip-build-env-t_3qg0ji\overlay\Lib\site-packages\setuptools\_distutils\_msvccompiler.py:539: UserWarning: Fallback spawn triggered. Please update distutils monkeypatch.
warnings.warn("Fallback spawn triggered. Please update distutils monkeypatch.")
error: Command "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\bin\HostX86\x64\cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Ispams_wrap -Ispams_wrap\linalg -Ispams_wrap\prox -Ispams_wrap\decomp -Ispams_wrap\dictLearn -IC:\Users\Foram\AppData\Local\Temp\pip-build-env-t_3qg0ji\overlay\Lib\site-packages\numpy\core\include -Ic:\users\foram\anaconda3\include -Ic:\users\foram\anaconda3\include -Ic:\users\foram\anaconda3\include -Ic:\users\foram\anaconda3\Include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt /EHsc /Tpspams_wrap/spams_wrap.cpp /Fobuild\temp.win-amd64-cpython-38\Release\spams_wrap\spams_wrap.obj -DNDEBUG -DUSE_BLAS_LIB -std=c++11 -fPIC -Wunused-variable -Wno-uninitialized -m64" failed with exit status 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for spams
Failed to build spams
ERROR: Could not build wheels for spams, which is required to install pyproject.toml-based projects
I tried searching solutions for the following:
Command line error D8021 : invalid numeric argument '/Wunused-variable'
Fallback spawn triggered. Please update distutils monkeypatch.
Could not build wheels for spams, which is required to install pyproject.toml-based projects
However, I could not find any clear solution. It would be great, if I could get some help.
Specs for my system is
Windows-10 64 bit
Python 3.8.5
When I am trying to install PyGObject I get an error. I am using Python 3.10 and Windows Command Prompt.
C:\windows\system32>pip install PyGObject
Collecting PyGObject
Using cached PyGObject-3.42.1.tar.gz (718 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: pycairo>=1.16.0 in c:\users\mona.hynes.lisdoon\appdata\local\programs\python\python310\lib\site-packages (from PyGObject) (1.21.0)
Building wheels for collected packages: PyGObject
Building wheel for PyGObject (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for PyGObject (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [48 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-310
creating build\lib.win-amd64-cpython-310\pygtkcompat
copying pygtkcompat\generictreemodel.py -> build\lib.win-amd64-cpython-310\pygtkcompat
copying pygtkcompat\pygtkcompat.py -> build\lib.win-amd64-cpython-310\pygtkcompat
copying pygtkcompat\__init__.py -> build\lib.win-amd64-cpython-310\pygtkcompat
creating build\lib.win-amd64-cpython-310\gi
copying gi\docstring.py -> build\lib.win-amd64-cpython-310\gi
copying gi\importer.py -> build\lib.win-amd64-cpython-310\gi
copying gi\module.py -> build\lib.win-amd64-cpython-310\gi
copying gi\pygtkcompat.py -> build\lib.win-amd64-cpython-310\gi
copying gi\types.py -> build\lib.win-amd64-cpython-310\gi
copying gi\_constants.py -> build\lib.win-amd64-cpython-310\gi
copying gi\_error.py -> build\lib.win-amd64-cpython-310\gi
copying gi\_gtktemplate.py -> build\lib.win-amd64-cpython-310\gi
copying gi\_option.py -> build\lib.win-amd64-cpython-310\gi
copying gi\_ossighelper.py -> build\lib.win-amd64-cpython-310\gi
copying gi\_propertyhelper.py -> build\lib.win-amd64-cpython-310\gi
copying gi\_signalhelper.py -> build\lib.win-amd64-cpython-310\gi
copying gi\__init__.py -> build\lib.win-amd64-cpython-310\gi
creating build\lib.win-amd64-cpython-310\gi\repository
copying gi\repository\__init__.py -> build\lib.win-amd64-cpython-310\gi\repository
creating build\lib.win-amd64-cpython-310\gi\overrides
copying gi\overrides\Gdk.py -> build\lib.win-amd64-cpython-310\gi\overrides
copying gi\overrides\GdkPixbuf.py -> build\lib.win-amd64-cpython-310\gi\overrides
copying gi\overrides\GIMarshallingTests.py -> build\lib.win-amd64-cpython-310\gi\overrides
copying gi\overrides\Gio.py -> build\lib.win-amd64-cpython-310\gi\overrides
copying gi\overrides\GLib.py -> build\lib.win-amd64-cpython-310\gi\overrides
copying gi\overrides\GObject.py -> build\lib.win-amd64-cpython-310\gi\overrides
copying gi\overrides\Gtk.py -> build\lib.win-amd64-cpython-310\gi\overrides
copying gi\overrides\keysyms.py -> build\lib.win-amd64-cpython-310\gi\overrides
copying gi\overrides\Pango.py -> build\lib.win-amd64-cpython-310\gi\overrides
copying gi\overrides\__init__.py -> build\lib.win-amd64-cpython-310\gi\overrides
running build_ext
pycairo: new API
pycairo: trying include directory: 'C:\\Users\\mona.hynes.LISDOON\\AppData\\Local\\Temp\\pip-build-env-6iivyiiw\\overlay\\Lib\\site-packages\\cairo\\include'
pycairo: found 'C:\\Users\\mona.hynes.LISDOON\\AppData\\Local\\Temp\\pip-build-env-6iivyiiw\\overlay\\Lib\\site-packages\\cairo\\include\\py3cairo.h'
building 'gi._gi' extension
creating build\temp.win-amd64-cpython-310
creating build\temp.win-amd64-cpython-310\Release
creating build\temp.win-amd64-cpython-310\Release\gi
"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DPY_SSIZE_T_CLEAN -IC:\Users\mona.hynes.LISDOON\AppData\Local\Temp\pip-install-zi8f2b72\pygobject_c02dc4480e0747d4bcd87d8b59ba11df -IC:\Users\mona.hynes.LISDOON\AppData\Local\Temp\pip-install-zi8f2b72\pygobject_c02dc4480e0747d4bcd87d8b59ba11df\gi -IC:\Users\mona.hynes.LISDOON\AppData\Local\Programs\Python\Python310\include -IC:\Users\mona.hynes.LISDOON\AppData\Local\Programs\Python\Python310\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\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 Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" /Tcgi\gimodule.c /Fobuild\temp.win-amd64-cpython-310\Release\gi\gimodule.obj -FImsvc_recommended_pragmas.h
gimodule.c
gi\gimodule.c: fatal error C1083: Cannot open include file: 'msvc_recommended_pragmas.h': No such file or directory
error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.31.31103\\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 PyGObject
Failed to build PyGObject
ERROR: Could not build wheels for PyGObject, which is required to install pyproject.toml-based projects
I had the same issue and the problem is that PyGObject needs to be compiled which will be done by default using Microsoft Visual Studio. This seems not to work. I also read somewhere that this won't work.
I managed to compile it using the instructions on https://pygobject.readthedocs.io/en/latest/getting_started.html but then got errors importing it into my project ('circular import'). Msys2 relies on python 3.9 by default, while I'm using 3.10. Could be related. Did not have time to look further, yet. So I'm happy for solutions to that :) Maybe will try changing to 3.9. later.
ERROR: Command errored out with exit status 1:
command: 'c:\users\nithi\appdata\local\programs\python\python39\python.exe' 'c:\users\nithi\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\nithi\AppData\Local\Temp\tmpba_qtkcq'
cwd: C:\Users\nithi\AppData\Local\Temp\pip-install-dq1r1ff8\argon2-cffi
Complete output (25 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\argon2
copying src\argon2\exceptions.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\low_level.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\_ffi_build.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\_legacy.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\_password_hasher.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\_utils.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\__init__.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\__main__.py -> build\lib.win-amd64-3.9\argon2
running build_clib
building 'argon2' library
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\extras
creating build\temp.win-amd64-3.9\extras\libargon2
creating build\temp.win-amd64-3.9\extras\libargon2\src
creating build\temp.win-amd64-3.9\extras\libargon2\src\blake2
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Iextras\libargon2\src\..\include -Iextras\libargon2\src\blake2 -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\include /Tcextras\libargon2\src\argon2.c /Fobuild\temp.win-amd64-3.9\extras\libargon2\src\argon2.obj
argon2.c
extras\libargon2\src\argon2.c(18): fatal error C1083: Cannot open include file: 'string.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.27.29110\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Failed building wheel for argon2-cffi
Failed to build argon2-cffi
ERROR: Could not build wheels for argon2-cffi which use PEP 517 and cannot be installed directly
I keep getting this error when I try to install jupyter notebook.
pip install notebook, this is the command I used on the command line.
One website suggested to install visual studio C++, Which I did and still no luck. Any help is appreciated. Thank you
This question already has answers here:
Jupyter Notebook installation error - Building wheel for argon2-cffi (PEP 517) ... error
(7 answers)
Closed 2 years ago.
This is the error that I get when I try to pip install notebook.
I am using Python3.9. I installed VS C++ Build tools and restarted my machine too.
Still can't seem to get jupyter installed, can someone please help with this? Thanks!
ERROR: Command errored out with exit status 1:
command: 'c:\users\sahi0h\appdata\local\programs\python\python39\python.exe' 'c:\users\sahi0h\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\sahi0h\AppData\Local\Temp\tmpgkwkmc6k'
cwd: C:\Users\sahi0h\AppData\Local\Temp\pip-install-29y4gn0n\argon2-cffi
Complete output (25 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\argon2
copying src\argon2\exceptions.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\low_level.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\_ffi_build.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\_legacy.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\_password_hasher.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\_utils.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\__init__.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\__main__.py -> build\lib.win-amd64-3.9\argon2
running build_clib
building 'argon2' library
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\extras
creating build\temp.win-amd64-3.9\extras\libargon2
creating build\temp.win-amd64-3.9\extras\libargon2\src
creating build\temp.win-amd64-3.9\extras\libargon2\src\blake2
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Iextras\libargon2\src\..\include -Iextras\libargon2\src\blake2 -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\include /Tcextras\libargon2\src\argon2.c /Fobuild\temp.win-amd64-3.9\extras\libargon2\src\argon2.obj
argon2.c
extras\libargon2\src\argon2.c(18): fatal error C1083: Cannot open include file: 'string.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.27.29110\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Failed building wheel for argon2-cffi
Failed to build argon2-cffi
ERROR: Could not build wheels for argon2-cffi which use PEP 517 and cannot be installed directly```
Found kind of a solution -- I uninstalled Python3.9 and installed Python3.8. Pip install is working now.
I'm having a very hard time installing MYSQLdb under Python 3.6. I've been fighting with this for about a day now and was hoping someone had a fix. Note I am running Windows 10, MY SQL Workbench 6.3, PyCharm 2016.3.2, and Python 3.6 as already mentioned. To begin with, when trying to execute code in PyCharm which includes an import of MYSQLdb, I'd get an error saying no module found. So, I of course tried to pip install basically every binary possible. For most, I'd get the following:
C:\Users\[me]>pip install mysql-python
Collecting mysql-python
Using cached MySQL-python-1.2.5.zip
Building wheels for collected packages: mysql-python
Running setup.py bdist_wheel for mysql-python ... error
Complete output from command c:\python36\python.exe -u -c "import
setuptools, tokenize;__file__='C:\\Users\\[me]\\AppData\\Local\\Temp\\pip-build-90yksnqx\\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\[me]\AppData\Local\Temp\tmprh_xynj1pip-wheel- --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
copying _mysql_exceptions.py -> build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win-amd64-3.6\MySQLdb
copying MySQLdb\converters.py -> build\lib.win-amd64-3.6\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-3.6\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win-amd64-3.6\MySQLdb
copying MySQLdb\release.py -> build\lib.win-amd64-3.6\MySQLdb
copying MySQLdb\times.py -> build\lib.win-amd64-3.6\MySQLdb
creating build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.6\MySQLdb\constants
running build_ext
building '_mysql' extension
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\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:\python36\include -Ic:\python36\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tc_mysql.c /Fobuild\temp.win-amd64-3.6\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 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
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 ... error
Complete output from command c:\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\[me]\\AppData\\Local\\Temp\\pip-build-90yksnqx\\mysql-python\\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\[me]\AppData\Local\Temp\pip-h7ydssnj-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
copying _mysql_exceptions.py -> build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win-amd64-3.6\MySQLdb
copying MySQLdb\converters.py -> build\lib.win-amd64-3.6\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-3.6\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win-amd64-3.6\MySQLdb
copying MySQLdb\release.py -> build\lib.win-amd64-3.6\MySQLdb
copying MySQLdb\times.py -> build\lib.win-amd64-3.6\MySQLdb
creating build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.6\MySQLdb\constants
running build_ext
building '_mysql' extension
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\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:\python36\include -Ic:\python36\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tc_mysql.c /Fobuild\temp.win-amd64-3.6\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 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
So, I even then tried installing the unofficial binary for 3.6 available at http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy
This installed fine, but still no luck when executing in PyCharm.
Next, I went into preferences=>project interpreter in PyCharm and tried to install MYSQLdb directly from there. With that, I get this other error:
Collecting MySQLdb
Could not find a version that satisfies the requirement MySQLdb (from versions: )
No matching distribution found for MySQLdb
From my research this seems to happen a lot when using new releases of Python. Does anyone know of a workaround or when 3.6 will be supported?
try to use sqlalchemy that is fully suported for many ODBC driver. Insted of using mysqldb, mysqlconnector is better in python3.x. I migrated a project from sqlite to mysql server and work fine in python3.6
sqlalchemy offer a solution for connecting with another ODBC.
I had this same issue.
I followed the advice of another answer and got to SQLAlchemy using the pip below:
pip install SQLAlchemy
I have been unable to play with it yet, but it did install without error, so here is hoping!
I had this issue before and I found out that when using python 3.6 you just need to install mysqlclient:
1 - create a folder and than a virtualenv (virtualenv myvenv --python python3)
2 - Install the django version you want (pip install django==1.9.3)
3- Install mysqlclient (pip install mysqlclient)
If you go inside myvenv folder/lib/python3.6/site-packages you will see that MySQLdb module will be there.