husio / python-sqlite3-backup

Sqlite3 online API CPython implementation module
http://pypi.python.org/pypi/sqlitebck/
42 stars 9 forks source link

pip install fails on Windows because a header file is missing #16

Closed BoarGules closed 5 years ago

BoarGules commented 5 years ago

pip install fails on Windows because a header file is missing:

    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I/usr/local/include -Ie:\python37\include -Ie:\python37\include "-IC:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include" "-IC:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\shared" /Tcsrc/sqlitebck.c /Fobuild\temp.win-amd64-3.7\Release\src/sqlitebck.obj
    sqlitebck.c
    c:\users\paulk\appdata\local\temp\pip-install-h3rc_o6t\sqlitebck\src\_sqlite/connection.h(33): fatal error C1083: Cannot open include file: 'sqlite3.h': No such file or directory
husio commented 5 years ago

Do you have python header files installed?

BoarGules commented 5 years ago

No,

I am on a Windows platform and, like most such users, I only compile Python extensions from source as a very last resort. I know that on other platforms, it is routine and mostly trouble-free. Not on Windows.

Microsoft does now include a C compiler and linker as part of the Windows OS distribution. So compiling extensions from source is now, finally, at least theoretically possible without having to buy Visual Studio. But MS also provides both a 32-bit and a 64-bit compiler, both of which can cross-compile to the other bitness, which means that there are 4 sets of header and lib files. Setting up the include and lib paths so that pip will do it all correctly may be fairly obvious for a C programmer, but is pretty baffling for the rest of us. I last programmed in C more than 20 years ago.

I did succeed in setting up the paths so that pip's notion of how to compile extensions on Windows would actually work. (It took me most of a day.) But I do expect when compiling a module from source that the package will include all source dependencies, and not assume that I have myself compiled other modules (or even Python itself, perish the thought) from source. Even if I were to download the header files for the Python standard library, I have no idea where I should put them so that pip's compile command would find them.

husio commented 5 years ago

I have no experience with Windows, so I am afraid I cannot help you. It looks like this is a missing sqlite3 header file, not python source files. Maybe a similar error topic on StackOverflow will help.

BoarGules commented 5 years ago

It is a pretty heavy prerequisite that before I can compile your module from source, I must first learn to compile sqlite3 from source. All I ask is that if your code does #include of a header file, then that header file should be in your package, and not assume that I will somehow have acquired it elsewhere. It's not about Windows. It's about a source package not having unresolved references.