I am trying to install lear-gist-python from github using Anaconda, but unfortunately, I am getting the below error. I even tried another windows system but got the same error.
running build
running build_ext
skipping 'src\leargist.c' Cython extension (up-to-date)
building 'leargist' extension
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\DXB\anaconda3\envs\gpu\lib\site-packages\numpy\core\include -Ilear_gist -IC:\Users\DXB\anaconda3\envs\gpu\include -IC:\Users\DXB\anaconda3\envs\gpu\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" /Tclear_gist/standalone_image.c /Fobuild\temp.win-amd64-3.8\Release\lear_gist/standalone_image.obj -DUSE_GIST -DSTANDALONE_GIST
standalone_image.c
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\DXB\anaconda3\envs\gpu\lib\site-packages\numpy\core\include -Ilear_gist -IC:\Users\DXB\anaconda3\envs\gpu\include -IC:\Users\DXB\anaconda3\envs\gpu\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" /Tclear_gist/gist.c /Fobuild\temp.win-amd64-3.8\Release\lear_gist/gist.obj -DUSE_GIST -DSTANDALONE_GIST
gist.c
lear_gist/gist.c(14): fatal error C1083: Cannot open include file: 'fftw3.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
You need to install FFTW as per the setup instructions of the library:
https://github.com/whitphx/lear-gist-python#fftw
FFTW installation guidelines can be found here:
https://www.fftw.org/fftw3_doc/Installation-and-Customization.html#Installation-and-Customization
Related
I try to build the wheel package with Cython in my project.
My command:
python setup.py bdist_wheel
It could build success with Python3.6, but fail with Python3.7 and Python3.8.
They have the same os environment variables and they have installed the same package dependency.
By comparing two kinds of output, I found that they use different msvc compiler.
Python3.6 works with msvc2019, the full compile command of Cython:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -IC:\Python36_64\include -IC:\Python36_64\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.25.28610\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.25.28610\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" /Tcbuild\myproject/myservice_obj.c /Fobuild\temp.win-amd64-3.6\Release\build\myproject/myservice_obj.obj
Python3.7 and Python3.8 work with msvc2014, the full compile command of Cython:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Python37_64\include -IC:\Python37_64\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-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" /Tcbuild\myproject/myservice_obj.c /Fobuild\temp.win-amd64-3.7\Release\build\myproject/myservice_obj.obj
Questions:
Why they have different setting of building process?
How to use msvc2019 to build package with python3.7?
i'm trying to install openssl using pip in order to use it with python.
i tried several versions and i get the same error!
i tried pip install cryptography and got the same error !
visual studion sdk builder is installed and worked for other packages.
please help, i attached the log after running "pip install pyopenssl !
log with the end error:
building '_openssl' extension
creating build\temp.win32-3.8\Release\build
creating build\temp.win32-3.8\Release\build\temp.win32-3.8
creating build\temp.win32-3.8\Release\build\temp.win32-3.8\Release
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\teich\PycharmProjects\first\venv\include -ID:\Users\teich\A
ppData\Local\Programs\Python\Python38-32\include -ID:\Users\teich\AppData\Local\Programs\Python\Python38-32\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\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Wind
ows 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" "-IC:\Program Files\OpenSSL-Win6
4\OpenSSL-win64" /Tcbuild\temp.win32-3.8\Release\_openssl.c /Fobuild\temp.win32-3.8\Release\build\temp.win32-3.8\Release\_openssl.obj
_openssl.c
build\temp.win32-3.8\Release\_openssl.c(498): fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory
I am working with apache 2.4.27, python 3.7 I need to install mod_wsgi.
I tried to install it via pip install mod_wsgi
it gives me this error:
running build_ext
building 'mod_wsgi.server.mod_wsgi' extension
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
creating build\temp.win-amd64-3.6\Release\src
creating build\temp.win-amd64-3.6\Release\src\server
cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Ic:\Apache24/include "-Ic:\program files (x86)\microsoft visual studio\shared\python36_64\include" "-Ic:\program files (x86)\microsoft visual studio\shared\python36_64\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" /Tcsrc/server\mod_wsgi.c /Fobuild\temp.win-amd64-3.6\Release\src/server\mod_wsgi.obj
error: command 'cl.exe' failed: No such file or directory
You may need to have cl.exe in your PATH.
PATH is an environment variable that tells Windows where to find executable files when you just give it the name. By default it contains locations such as C:\Windows.
You have two options here.
Use the Visual C++ Command Prompt. You can find it in the Start Menu
under the Visual Studio folder. This sets up PATH automatically.
Add the folder cl.exe is in to the PATH manually.
The folder you're looking for is generally (visual studio folder)\VC\bin. Instructions can be found in this answer. After this you can use cl.exe from any Command Prompt. Note that you have to restart the Command Prompt after this in order to update the PATH in it.
I am trying to follow this tutorial to be abe to use C code in python. http://dfm.io/posts/python-c-extensions/
here is the gist https://gist.github.com/GreenJoey/b08528d6abe62da70f28f73c39c0efd0
when I try to compile it using python setup.py build_ext --inplace it fails with this error message:
running build_ext
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
building '_chi2' 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 -IC:\Users\XXX\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\core\include -IC:\Users\XXX\AppData\Local\Continuum\anaconda3\include -IC:\Users\XXX\AppData\Local\Continuum\anaconda3\include -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\8.1\include\shared" -I"C:\Program Files (x86)\Windows Kits\8.1\include\um" -I"C:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tc_chi2.c /Fobuild\temp.win-amd64-3.6\Release\_chi2.obj
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\XXX\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\core\include -IC:\Users\XXX\AppData\Local\Continuum\anaconda3\include -IC:\Users\XXX\AppData\Local\Continuum\anaconda3\include -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\8.1\include\shared" -I"C:\Program Files (x86)\Windows Kits\8.1\include\um" -I"C:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tcchi2.c /Fobuild\temp.win-amd64-3.6\Release\chi2.obj
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\XXX\AppData\Local\Continuum\anaconda3\libs /LIBPATH:C:\Users\XXX\AppData\Local\Continuum\anaconda3\PCbuild\amd64 /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64" /EXPORT:PyInit__chi2 build\temp.win-amd64-3.6\Release\_chi2.obj build\temp.win-amd64-3.6\Release\chi2.obj /OUT:C:\workspace\c\b08528d6abe62da70f28f73c39c0efd0-a1d1f0469637e3a3578ab5f8ee0e641a8e31d572\_chi2.cp36-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.6\Release\_chi2.cp36-win_amd64.lib
LINK : error LNK2001: unresolved external symbol PyInit__chi2
build\temp.win-amd64-3.6\Release\_chi2.cp36-win_amd64.lib : fatal error LNK1120: 1 unresolved externals
error: Command "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\XXX\AppData\Local\Continuum\anaconda3\libs /LIBPATH:C:\Users\XXX\AppData\Local\Continuum\anaconda3\PCbuild\amd64 /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64" /EXPORT:PyInit__chi2 build\temp.win-amd64-3.6\Release\_chi2.obj build\temp.win-amd64-3.6\Release\chi2.obj /OUT:C:\workspace\c\b08528d6abe62da70f28f73c39c0efd0-a1d1f0469637e3a3578ab5f8ee0e641a8e31d572\_chi2.cp36-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.6\Release\_chi2.cp36-win_amd64.lib" failed with exit status 1120
looks like it cannot find unresolved external symbol PyInit__chi2 but the method is defined. see https://gist.github.com/GreenJoey/b08528d6abe62da70f28f73c39c0efd0#file-_chi2-c-L33
I understand that it is a linking error, but I only import "Python.h" once so I do not understand why it cannot find the method.
In my case this error was due to a mismatch between the module name I provided in setup.py and the module name used in the PYBIND11_MODULE() macro in my cpp bindings file (first argument to the macro).
I found the soultion here https://gist.github.com/douglas-larocca/099bf7460d853abb7c17
PyInit has to be marked with PyMODINIT_FUNC
PyMODINIT_FUNC PyInit__chi2(void)
{
PyObject *module;
static struct PyModuleDef moduledef = {
PyModuleDef_HEAD_INIT,
"_chi2",
module_docstring,
-1,
module_methods,
NULL,
NULL,
NULL,
NULL
};
module = PyModule_Create(&moduledef);
if (!module) return NULL;
/* Load `numpy` functionality. */
import_array();
return module;
}
I'm trying to build qpython (the kdb python interface) for python 3.6.3 (Anaconda) running on windows 7.
After downloading and unpacking qPython-qPython-1.2.2.zip
Executing "python setup.py build_ext --inplace"
gives...
running build_ext
building 'qpython.fastutils' extension
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\wilsoroh\AppData\Local\Continuum\Anaconda3\lib\site-packages\numpy\core\inclu
de -IC:\Users\wilsoroh\AppData\Local\Continuum\Anaconda3\include -IC:\Users\wilsoroh\AppData\Local\Continuum\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\
Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\u
m" "-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" "-IC:\Program Files\Sy
base\OCS-15_0\include\" /Tcqpython/fastutils.c /Fobuild\temp.win-amd64-3.6\Release\qpython/fastutils.obj
cl : Command line error D8003 : missing source filename
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
Which looks like setup is simply not setting the paths up correctly for the compiler.
A look in the qpython directory below shows fastutils.c sitting there waiting to be compiled.
This kind of thing seems to be a regular problem when trying to build python extensions on windows.
Any help / suggestions greatly appreciated.