Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build docker image: ImportError: Couldn't import Django #328

Open
pattyland opened this issue Dec 10, 2024 · 0 comments
Open

Cannot build docker image: ImportError: Couldn't import Django #328

pattyland opened this issue Dec 10, 2024 · 0 comments

Comments

@pattyland
Copy link

pattyland commented Dec 10, 2024

Describe the bug
Building the docker image I get the error ImportError: Couldn't import Django at the last step. Stracktrace is attached

To Reproduce
Steps to reproduce the behavior:

  1. Follow the steps on https://pytition.readthedocs.io/en/latest/installation.html#installation-via-docker-recommended-for-development
  2. use the docker compose up --build command
  3. See error

Expected behavior
Successful build of Docker Image

Screenshots

✔ Container pytition-smtp-1  Created                                                                                                                                                                                        0.0s 
 ✔ Container pytition-db-1    Created                                                                                                                                                                                        0.0s 
 ✔ Container pytition-web-1   Recreated                                                                                                                                                                                      0.3s 
Attaching to db-1, smtp-1, web-1
db-1    | 
db-1    | PostgreSQL Database directory appears to contain a database; Skipping initialization
db-1    | 
db-1    | 2024-12-10 13:30:25.438 UTC [1] LOG:  starting PostgreSQL 17.2 (Debian 17.2-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
db-1    | 2024-12-10 13:30:25.439 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
db-1    | 2024-12-10 13:30:25.439 UTC [1] LOG:  listening on IPv6 address "::", port 5432
db-1    | 2024-12-10 13:30:25.456 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db-1    | 2024-12-10 13:30:25.481 UTC [27] LOG:  database system was shut down at 2024-12-10 13:29:58 UTC
db-1    | 2024-12-10 13:30:25.501 UTC [1] LOG:  database system is ready to accept connections
smtp-1  | MailDev webapp running at http://0.0.0.0:8080
smtp-1  | MailDev SMTP Server running at 0.0.0.0:2525
web-1   | Traceback (most recent call last):
web-1   |   File "pytition/manage.py", line 8, in <module>
web-1   |     from django.core.management import execute_from_command_line
web-1   | ModuleNotFoundError: No module named 'django'
web-1   | 
web-1   | During handling of the above exception, another exception occurred:
web-1   | 
web-1   | Traceback (most recent call last):
web-1   |   File "pytition/manage.py", line 14, in <module>
web-1   |     import django
web-1   | ModuleNotFoundError: No module named 'django'
web-1   | 
web-1   | During handling of the above exception, another exception occurred:
web-1   | 
web-1   | Traceback (most recent call last):
web-1   |   File "pytition/manage.py", line 16, in <module>
web-1   |     raise ImportError(
web-1   | ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
web-1 exited with code 1

Desktop (please complete the following information):

  • OS: AlmaLinux release 8.10 (Cerulean Leopard)
  • Browser -
  • Version -

Additional context
Would be really nice to prevent possible problems like this by resolving #168

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant