Closed tomasz-jankowski closed 4 months ago
I'm trying to setup Django under Docker. It seems that for some reason docker-environ is not installed.
rkn-web-1 | File "/app/rkn/settings.py", line 21, in <module> rkn-web-1 | import environ rkn-web-1 | ModuleNotFoundError: No module named 'environ'
Dockerfile:
FROM python:3.12-slim WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY . . CMD ["python", "manage.py", "runserver", "0.0.0.0:${PORT}"]
requirements.txt
asgiref==3.7.2 Django==5.0.2 django-environ==0.11.2 psycopg==3.1.18 psycopg-binary==3.1.18 setuptools==69.1.1 sqlparse==0.4.4 typing_extensions==4.10.0
Docker build process output include django-environ installation:
#8 6.845 Successfully installed Django-5.0.2 asgiref-3.7.2 django-environ-0.11.2 psycopg-3.1.18 psycopg-binary-3.1.18 setuptools-69.1.1 sqlparse-0.4.4 typing_extensions-4.10.0
Getting pip packages from a container bash (django-environ missing):
root@23c0a88c754f:/app# pip freeze asgiref==3.7.2 Django==5.0.2 psycopg==3.1.18 psycopg-binary==3.1.18 setuptools==69.1.1 sqlparse==0.4.4 typing_extensions==4.10.0 wheel==0.42.0
Output of installed packages (django-environ missing):
from pkg_resources import working_set installed_packages = ("%s==%s" % (i.key, i.version) for i in working_set) installed_packages_list = sorted(installed_packages) print(installed_packages_list) ['asgiref==3.7.2', 'django==5.0.2', 'pip==24.0', 'psycopg-binary==3.1.18', 'psycopg==3.1.18', 'setuptools==69.1.1', 'sqlparse==0.4.4', 'typing-extensions==4.10.0', 'wheel==0.42.0']
I'm trying to setup Django under Docker. It seems that for some reason docker-environ is not installed.
Dockerfile:
requirements.txt
Docker build process output include django-environ installation:
Getting pip packages from a container bash (django-environ missing):
Output of installed packages (django-environ missing):