skip to Main Content

I can’t install WSGI for Python. I have tried lots of things.
I have installed the latest versions of pip, python, apache, setuptools.
I can’t understand why WSGI is not installing

I have started learning python a few days ago on my own.
I have watched lots of videos and i’ve read lots of informations in different forums. But i couldn’t solve this problem
Maybe i’m doing something wrong

D:ItConsole2>pip install mod_wsgi
Collecting mod_wsgi
  Using cached mod_wsgi-4.7.1.tar.gz (498 kB)
Building wheels for collected packages: mod-wsgi
  Building wheel for mod-wsgi (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'd:itpythonpython.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\TheFlash\AppData\Local\Temp\pip-install-ih8ke_\mod-wsgi\setup.py'"'"'; __file__='"'"'C:\Users\TheFlash\AppData\Local\Temp\pip-install-55ih8ke_\mod-wsgi\setup.py'"'"';f=getattr(tokeniz '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheeld 'C:UsersTheFlashAppDataLocalTemppip-wheel-xh383iwl'
       cwd: C:UsersTheFlashAppDataLocalTemppip-install-55ih8ke_mod-wsgi
  Complete output (33 lines):
  d:itpythonlibdistutilsdist.py:261: UserWarning: Unknown distribution option: 'bugtrack_url'
    warnings.warn(msg)
  running bdist_wheel
  running build
  running build_py
  creating build
  creating buildlib.win-amd64-3.6
  creating buildlib.win-amd64-3.6mod_wsgi
  copying src__init__.py -> buildlib.win-amd64-3.6mod_wsgi
  creating buildlib.win-amd64-3.6mod_wsgiserver
  copying srcserverapxs_config.py -> buildlib.win-amd64-3.6mod_wsgiserver
  copying srcserverenviron.py -> buildlib.win-amd64-3.6mod_wsgiserver
  copying srcserver__init__.py -> buildlib.win-amd64-3.6mod_wsgiserver
  creating buildlib.win-amd64-3.6mod_wsgiservermanagement
  copying srcservermanagement__init__.py -> buildlib.win-amd64-3.6mod_wsgiservermanagement
  creating buildlib.win-amd64-3.6mod_wsgiservermanagementcommands
  copying srcservermanagementcommandsrunmodwsgi.py -> buildlib.win-amd64-3.6mod_wsgiservermanagementcommands
  copying srcservermanagementcommands__init__.py -> buildlib.win-amd64-3.6mod_wsgiservermanagementcommands
  creating buildlib.win-amd64-3.6mod_wsgidocs
  copying docs_buildhtml__init__.py -> buildlib.win-amd64-3.6mod_wsgidocs
  creating buildlib.win-amd64-3.6mod_wsgiimages
  copying images__init__.py -> buildlib.win-amd64-3.6mod_wsgiimages
  copying imagessnake-whiskey.jpg -> buildlib.win-amd64-3.6mod_wsgiimages
  running build_ext
  building 'mod_wsgi.server.mod_wsgi' extension
  creating buildtemp.win-amd64-3.6
  creating buildtemp.win-amd64-3.6Release
  creating buildtemp.win-amd64-3.6Releasesrc
  creating buildtemp.win-amd64-3.6Releasesrcserver
  C:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.25.28610binHostX86x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IDItApache/include -Id:itpythoninclude -Id:itpythoninclude "-IC:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.25.286include" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0ucrt" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0shared" "-IProgram Files (x86)Windows Kits10include10.0.18362.0um" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0winrt" "-IC:Program Files (6)Windows Kits10include10.0.18362.0cppwinrt" /Tcsrc/servermod_wsgi.c /Fobuildtemp.win-amd64-3.6Releasesrc/servermod_wsgi.obj
  mod_wsgi.c
  C:UsersTheFlashAppDataLocalTemppip-install-55ih8ke_mod-wsgisrcserverwsgi_apache.h(42): fatal error C1083: ?? г¤ ?вбп RвЄалвм д c< ўЄ<оз?-Ё?:
tpd.h: No such file or directory,
  error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64\cl.exe' failed witexit status 2
  ----------------------------------------
  ERROR: Failed building wheel for mod-wsgi
  Running setup.py clean for mod-wsgi
Failed to build mod-wsgi
Installing collected packages: mod-wsgi
    Running setup.py install for mod-wsgi ... error
    ERROR: Command errored out with exit status 1:
     command: 'd:itpythonpython.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\TheFlash\AppData\Local\Temp\pip-instal55ih8ke_\mod-wsgi\setup.py'"'"'; __file__='"'"'C:\Users\TheFlash\AppData\Local\Temp\pip-install-55ih8ke_\mod-wsgi\setup.py'"'"';f=getattr(tokene, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install -ecord 'C:UsersTheFlashAppDataLocalTemppip-record-vqudmtwminstall-record.txt' --single-version-externally-managed --compile --install-headers 'd:ipythonIncludemod-wsgi'
         cwd: C:UsersTheFlashAppDataLocalTemppip-install-55ih8ke_mod-wsgi
    Complete output (33 lines):
    d:itpythonlibdistutilsdist.py:261: UserWarning: Unknown distribution option: 'bugtrack_url'
      warnings.warn(msg)
    running install
    running build
    running build_py
    creating build
    creating buildlib.win-amd64-3.6
    creating buildlib.win-amd64-3.6mod_wsgi
    copying src__init__.py -> buildlib.win-amd64-3.6mod_wsgi
    creating buildlib.win-amd64-3.6mod_wsgiserver
    copying srcserverapxs_config.py -> buildlib.win-amd64-3.6mod_wsgiserver
    copying srcserverenviron.py -> buildlib.win-amd64-3.6mod_wsgiserver
    copying srcserver__init__.py -> buildlib.win-amd64-3.6mod_wsgiserver
    creating buildlib.win-amd64-3.6mod_wsgiservermanagement
    copying srcservermanagement__init__.py -> buildlib.win-amd64-3.6mod_wsgiservermanagement
    creating buildlib.win-amd64-3.6mod_wsgiservermanagementcommands
    copying srcservermanagementcommandsrunmodwsgi.py -> buildlib.win-amd64-3.6mod_wsgiservermanagementcommands
    copying srcservermanagementcommands__init__.py -> buildlib.win-amd64-3.6mod_wsgiservermanagementcommands
    creating buildlib.win-amd64-3.6mod_wsgidocs
    copying docs_buildhtml__init__.py -> buildlib.win-amd64-3.6mod_wsgidocs
    creating buildlib.win-amd64-3.6mod_wsgiimages
    copying images__init__.py -> buildlib.win-amd64-3.6mod_wsgiimages
    copying imagessnake-whiskey.jpg -> buildlib.win-amd64-3.6mod_wsgiimages
    running build_ext
    building 'mod_wsgi.server.mod_wsgi' extension
    creating buildtemp.win-amd64-3.6
    creating buildtemp.win-amd64-3.6Release
    creating buildtemp.win-amd64-3.6Releasesrc
    creating buildtemp.win-amd64-3.6Releasesrcserver
    C:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.25.28610binHostX86x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -:ItApache/include -Id:itpythoninclude -Id:itpythoninclude "-IC:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.25.210include" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0ucrt" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0shared" "C:Program Files (x86)Windows Kits10include10.0.18362.0um" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0winrt" "-IC:Program Filesx86)Windows Kits10include10.0.18362.0cppwinrt" /Tcsrc/servermod_wsgi.c /Fobuildtemp.win-amd64-3.6Releasesrc/servermod_wsgi.obj
    mod_wsgi.c
    C:UsersTheFlashAppDataLocalTemppip-install-55ih8ke_mod-wsgisrcserverwsgi_apache.h(42): fatal error C1083: ?? г¤ ?вбп RвЄалвм д c< ўЄ<оз?-Ё?httpd.h: No such file or directory,
    error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64\cl.exe' failed wh exit status 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'd:itpythonpython.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\TheFlashppData\Local\Temp\pip-install-55ih8ke_\mod-wsgi\setup.py'"'"'; __file__='"'"'C:\Users\TheFlash\AppData\Local\Temp\pip-install-55ih8ke_\mod-ws\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __fi__, '"'"'exec'"'"'))' install --record 'C:UsersTheFlashAppDataLocalTemppip-record-vqudmtwminstall-record.txt' --single-version-externally-managed
compile --install-headers 'd:itpythonIncludemod-wsgi' Check the logs for full command output.

2

Answers


  1. EDIT:

    You might be able to find your solution from this answer

    Here are steps that I took:

    Install python x64 (may need to double check you downloaded the right one for your OS)

    Install pip

    Install Apache

    Moved the extracted Apache24 folder to C:

    Set the env variable for apache with set "MOD_WSGI_APACHE_ROOTDIR=C:Apache24"

    Install Microsoft C++ build tools

    Restart machine

    Run pip install mod_wsgi

    Login or Signup to reply.
  2. If pip install mod_wsgi-binary is not working. Then try to download this from source instead of pip.
    Download from the given link by following the instructions in readme file.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search