Apache and mod_wsgi - python

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.

Related

Unable to install library from Github using Jupyter Notebook

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

LINK : fatal error LNK1104: cannot open file 'OLDNAMES.lib'

I am trying to install glumpy by running pip install glumpy. It downloads the wheel for glumpy (and triangle) and then, while building the wheel, spits out
E:\-----\Development\VisualStudio\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DVOID=void -DREAL=double -DNO_TIMER=1 -DTRILIBRARY=1 -DANSI_DECLARATORS=1 -Ic -IE:\*****\Anaconda3\envs\quad\include -IE:\*****\Anaconda3\envs\quad\include -IE:\-----\Development\VisualStudio\VC\Tools\MSVC\14.15.26726\ATLMFC\include -IE:\-----\Development\VisualStudio\VC\Tools\MSVC\14.15.26726\include "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-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\cppwinrt" /Tctriangle/core.c /Fobuild\temp.win-amd64-3.8\Release\triangle/core.obj
core.c
E:\-----\Development\VisualStudio\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:E:\*****\Anaconda3\envs\quad\libs /LIBPATH:E:\*****\Anaconda3\envs\quad\PCbuild\amd64 /LIBPATH:E:\-----\Development\VisualStudio\VC\Tools\MSVC\14.15.26726\ATLMFC\lib\x64 /LIBPATH:E:\-----\Development\VisualStudio\VC\Tools\MSVC\14.15.26726\lib\x64 "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.17134.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.17134.0\um\x64" /EXPORT:PyInit_core build\temp.win-amd64-3.8\Release\c/triangle.obj build\temp.win-amd64-3.8\Release\triangle/core.obj /OUT:build\lib.win-amd64-3.8\triangle\core.cp38-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.8\Release\c\core.cp38-win_amd64.lib
LINK : fatal error LNK1104: cannot open file 'OLDNAMES.lib'
error: command 'E:\\-----\\Development\\VisualStudio\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x64\\link.exe' failed with exit status 1104
----------------------------------------
ERROR: Failed building wheel for glumpy
I googled around and saw an old solution
Solution 1:
Include following directory in LIB Environment Variable:
C:\Program Files\Microsoft Visual Studio 9.0\VC\lib
But I don't have a LIB env variable and the directory and similar directories do not exist.
Please help, I've been trying to install this package for nonths!
Update: I got my hands on some wheels for triangle, which I could install. If there are wheels of glumpy for win_amd64, please point me to them!
Neither glumpy nor triangle provide binary wheels, they only provide source code. To compile them you need to install a lot of C/C++/Python dependencies.
For triangle you need https://www.cs.cmu.edu/~quake/triangle.html.
For glumpy: https://github.com/glumpy/glumpy#dependencies
Upd. I see triangle's makefile requires Unix programs (/bin/rm) and X Windows libraries. This seem to be Unix-only package. Not for Windows.

error installing openssl for python (pip)

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

`Cannot open include file: 'apr_perms_set.h'` when doing `pip install mod_wsgi`

I am trying to roll out a production Django environment on Windows 10 with Apache 2.4.37 x64 OpenSSL 1.1.1 VC14 from ApacheHaus. However, when following these instructions, I'm getting the following error:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -ID:/Servers/Web/Apache/Apache24/include -Ic:\programs\python37\include -Ic:\programs\python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-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" /Tcsrc/server\mod_wsgi.c /Fobuild\temp.win-amd64-3.7\Release\src/server\mod_wsgi.obj
mod_wsgi.c
d:\servers\web\apache\apache24\include\apr_network_io.h(29): fatal error C1083: Cannot open include file: 'apr_perms_set.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
Failed building wheel for mod-wsgi
I see the following options to C/C++ compiler: -ID:/Servers/Web/Apache/Apache24/include -Ic:\programs\python37\include . So it seems include file apr_perms_set.h is missing from Apache or Python.
How to fix this error with the correct versions of the include files? I'm afraid it's wrong to just take the latest version from a repository because it may not match what's Apache or mod-wsgi expect.
I had similar error on Windows Server 2016, when trying to use Apache 2.4 64bit with Python 2.7. Apparently apr header files were missing. I was able to solve it by:
making sure I have both Apache and Python 64bit (guess it'll be valid
for 32bit as well) installing VC++
Redistributable - of course 64bit in my case
downloading Apache Runtime (apr) headers from APR project website
copying missing header file from downloaded sources into Apache's include folder
installing mod_wsgi with pip install mod_wsgi (inside my virtual environment).
The distribution from The Apache Haus does not include the aforementioned header file for some strange reason. Try using the distribution from Apache Lounge, it should contain all header files needed to compile mod_wsgi (tested with httpd-2.4.41-win32-VS16.zip).
You can download the missing file from Github and copy it in the directory
C:/Apache24/include

Compilation of Python extension on windows fails with missing source filename error D8003

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.

Categories