mod_wsgi
mod_wsgi copied to clipboard
How to build mod_wsgi on windows
Hi there
I am trying to configure mod_wsgi on windows server but facing issue while running apache httpd server.
[Sat Sep 04 18:39:34.203678 2021] [so:debug] [pid 2660:tid 484] mod_so.c(266): AH01575: loaded module wsgi_module from C:/Projects/django-wsgi/venv375/Lib/site-packages/mod_wsgi/server/mod_wsgi.cp37-win_amd64.pyd Fatal Python error: initfsencoding: unable to load the file system codec ModuleNotFoundError: No module named 'encodings'
Current thread 0x00001510 (most recent call first): [Sat Sep 04 18:39:35.625455 2021] [mpm_winnt:crit] [pid 11916:tid 532] AH00419: master_main: create child process failed. Exiting.
My environment is Python 3.7.5 64 bit ; Apache 2.4.48 (64 bit).
so I was thinking of compiling mod_wsgi on windows but link provided on this page is broken. https://modwsgi.readthedocs.io/en/master/installation.html
https://github.com/GrahamDumpleton/mod_wsgi/blob/develop/win32/README.rst - this link is broken.
so could you please send me instruction for building mod_wsgi on windows?
Regards
swanand
is broken.
The pip method is the correct method. The docs is old and needs to be corrected as it referred to an installation method that was stopped being used some time back.
The only suggestion can give right now are:
- Ensure that Python is installed for all users and not just your user.
- Ensure that if using a Python virtual environment that it is located somewhere that the separate system user Apache runs as can access it.
- Avoid using Anaconda Python.
This doesn't necessarily always work though.
The problem is that Python broke its ability to be used in embedded systems on Windows with virtual environments a long time ago and it has never been fixed. There are some workarounds in mod_wsgi to try and get it working, but for some reason the workaround doesn't always work. It is not really fully known why it works for some and not others.