No module named wsgi

12,050

Solution 1

You've confused yourself by following an unnecessarily complicated structure. You don't need that outer meraki directory, and your Procfile and requirements.txt should be in the same directory as manage.py. Then you can remove the pythonpath parameter and all should be well.

Solution 2

As Roseman said, it is unnecessarily complicated structure.If you want it to do so,Try

web: gunicorn --pythonpath /path/to/meraki meraki.wsgi

That is /absolutepath/to/secondmeroki(out of 3) which contains apps.

Share:
12,050
Jahongir Rahmonov
Author by

Jahongir Rahmonov

Software Engineer at Delivery Hero rahmonov.me

Updated on June 04, 2022

Comments

  • Jahongir Rahmonov
    Jahongir Rahmonov almost 2 years

    This is what I have in my Procfile:

    web: gunicorn --pythonpath meraki meraki.wsgi
    

    and when I do foreman start, I get this error:

    gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
    

    the reason, as far as I can see in the traceback, is:

    ImportError: No module named wsgi
    

    I did import wsgi in the shell and the import was successful, no errors.

    Why can't I start foreman?

    Project Structure:

    meraki
      meraki
          //other apps
          meraki
              settings
              __init__.py
              celery.py
              views.py
              wsgi.py
          manage.py
      Procfile
      requirements
      requirements.txt