Gunicorn failed to load the wsgi module
Hey everyone, I hope you're all doing well.
I'm currently working on a Django project, and I've encountered an issue when trying to run it with Gunicorn. I would greatly appreciate your assistance in resolving this problem.
Issue Description:
I'm trying to deploy my Django application using Gunicorn, but I'm encountering a 'ModuleNotFoundError' related to the wsgi 'locallibrary' module. It seems that Gunicorn cannot find the wsgi path. As a developer I need to say it working on my machine π so I can guess it related to the python server path - but i dont know how to see the project structure inside the railway...
my project id: 9bc78e3f-4204-46e6-8951-eadca9c6f04f
![No description](https://cdn.answeroverflow.com/1169913919586963537/Screenshot_2023-11-03_at_07.44.47.png)
29 Replies
Project ID:
9bc78e3f-4204-46e6-8951-eadca9c6f04f
it works locally, but does it work locally with gunicorn?
Yep
I tried to change the path and got the same error so I guess it because the railway deployment use different paths structure then me. But as I said, I don't know how to access the project structure itself...
not sure how much help we can provide since this is a code issue, but send your deployment logs and maybe we will see something simple https://bookmarklets.up.railway.app/log-downloader/
I saw it, but it related to the wsgi loading.
Look at this row:
File "/opt/venv/lib/python3.11/site-packages/gunicorn/arbiter.py", line 609, in spawn_worker
The venv doesn't exist inside the project - it exist in the opt folder and I think it railway folder infra because I dont have any folder with this name...
please tackle this problem first
This is the same problem, the wsgi lloading failed because the import failure.
This is my project structure:
crm
ββ .gitignore
ββ Procfile
ββ crm
β ββ asgi.py
β ββ settings.py
β ββ urls.py
β ββ wsgi.py
ββ manage.py
ββ requirements.txt
ββ runtime.txt
ββ website
ββ admin.py
ββ apps.py
ββ forms.py
ββ models.py
ββ templates
β ββ test.html
ββ tests.py
ββ urls.py
ββ views.py
wsgi file:
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'crm.settings')
application = get_asgi_application()
Procfile:
web: manage.py makemigrations && python manage.py migrate && python manage.py collectstatic --no-input && gunicorn crm.wsgi
have you fixed this error?
This is the error π’
I just say the source of it came from the problem with wsgi
and Idk how to solve it
do you have
locallibrary
in your requirements.txt?no, and not in all my project, idk from where it come
I try to search it in all my file without any clue
please watch this video https://www.youtube.com/watch?v=oLlT6c6jA-M
pip install locallibrary
ERROR: Could not find a version that satisfies the requirement locallibrary (from versions: none)
ERROR: No matching distribution found for locallibrary