Whats wrong with my wsgi configuration on Windows with apache?

  apache, python, python-3.x, windows

I developed an application with Flask, now I try to run it using apache, but an error occurs.

These are the lines for the config file:

LoadFile "C:Usersuserappdatalocalprogramspythonpython38python38.dll"
LoadModule wsgi_module "C:Usersuserappdatalocalprogramspythonpython38libsite-packagesmod_wsgiservermod_wsgi.cp38-win_amd64.pyd"
WSGIPythonHome "C:Usersuserappdatalocalprogramspythonpython38"

Log file:

The 'Apache2.4' service is running.
pm_winnt:notice] [pid 6044:tid 776] AH00455: Apache/2.4.51 (Win64) mod_wsgi/4.9.0 Python/3.8 configured -- resuming normal operations
[Sun Oct 10 01:57:17.809174 2021] [mpm_winnt:notice] [pid 6044:tid 776] AH00456: Apache Lounge VS16 Server built: Oct  7 2021 16:27:02
[Sun Oct 10 01:57:17.809174 2021] [core:notice] [pid 6044:tid 776] AH00094: Command line: 'C:Apache24binhttpd.exe -d C:/Apache24'
[Sun Oct 10 01:57:17.840444 2021] [mpm_winnt:notice] [pid 6044:tid 776] AH00418: Parent: Created child process 704
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = 'python'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = 'C:Apache24binhttpd.exe'
  sys.base_prefix = 'C:UsersuserAppDataLocalProgramsPythonPython38'
  sys.base_exec_prefix = 'C:UsersuserAppDataLocalProgramsPythonPython38'
  sys.executable = 'C:Apache24binhttpd.exe'
  sys.prefix = 'C:UsersuserAppDataLocalProgramsPythonPython38'
  sys.exec_prefix = 'C:UsersuserAppDataLocalProgramsPythonPython38'
  sys.path = [
    'C:UsersuserAppDataLocalProgramsPythonPython38python38.zip',
    '.DLLs',
    '.lib',
    'C:Apache24bin',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00000354 (most recent call first):
<no Python frame>
[Sun Oct 10 01:57:18.371700 2021] [mpm_winnt:crit] [pid 6044:tid 776] AH00419: master_main: create child process failed. Exiting.

Source: Windows Questions

LEAVE A COMMENT