자유게시판
여러분의 의견을 자유롭게 알려주세요.
하지만, 책을 끝까지 읽고 나면 이 페이지도 만드실 수 있을거에요.
p.582 에러가 발생합니다,
2 years, 8 months ago
qwefghnm1212안녕하세요 작가님 잘 지내시나요??
다름이 아니라 p.582 쪽을 실습하고 있는데 오류가 발생합니다.
일단 밑에는 오류 내용입니다.!
```
(venv) PS C:\mywork\Jusarang_Youth_Web> docker-compose up --build
[+] Building 20.4s (9/9) FINISHED
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 32B 0.0s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/python:3.9-slim-buster 3.5s
=> [1/5] FROM docker.io/library/python:3.9-slim-buster@sha256:50e50d77a71944baa9b6f4e903d12ff3b5b6b1120ab6c 0.0s
=> [internal] load build context 4.0s
=> => transferring context: 1.60MB 3.9s
=> CACHED [2/5] WORKDIR /usr/src/app 0.0s
=> CACHED [3/5] COPY . /usr/src/app/ 0.0s
=> CACHED [4/5] RUN pip install --upgrade pip 0.0s
=> ERROR [5/5] RUN pip install -r requirements.txt 12.7s
------
> [5/5] RUN pip install -r requirements.txt:
#9 1.599 Collecting asgiref==3.5.0
#9 1.695 Downloading asgiref-3.5.0-py3-none-any.whl (22 kB)
#9 1.783 Collecting asttokens==2.0.5
#9 1.805 Downloading asttokens-2.0.5-py2.py3-none-any.whl (20 kB)
#9 1.854 Collecting backcall==0.2.0
#9 1.868 Downloading backcall-0.2.0-py2.py3-none-any.whl (11 kB)
#9 1.926 Collecting beautifulsoup4==4.10.0
#9 1.937 Downloading beautifulsoup4-4.10.0-py3-none-any.whl (97 kB)
#9 1.962 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.4/97.4 KB 4.4 MB/s eta 0:00:00
#9 2.015 Collecting black==22.1.0
#9 2.030 Downloading black-22.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB)
#9 2.225 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.5/1.5 MB 7.7 MB/s eta 0:00:00
#9 2.276 Collecting certifi==2021.10.8
#9 2.288 Downloading certifi-2021.10.8-py2.py3-none-any.whl (149 kB)
#9 2.318 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 149.2/149.2 KB 5.3 MB/s eta 0:00:00
#9 2.593 Collecting cffi==1.15.0
#9 2.607 Downloading cffi-1.15.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (444 kB)
#9 2.672 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 444.3/444.3 KB 7.3 MB/s eta 0:00:00
#9 2.717 Collecting charset-normalizer==2.0.12
#9 2.730 Downloading charset_normalizer-2.0.12-py3-none-any.whl (39 kB)
#9 2.792 Collecting click==8.0.4
#9 2.807 Downloading click-8.0.4-py3-none-any.whl (97 kB)
#9 2.831 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.5/97.5 KB 4.2 MB/s eta 0:00:00
#9 2.879 Collecting colorama==0.4.4
#9 2.890 Downloading colorama-0.4.4-py2.py3-none-any.whl (16 kB)
#9 3.237 Collecting cryptography==36.0.1
#9 3.254 Downloading cryptography-36.0.1-cp36-abi3-manylinux_2_24_x86_64.whl (3.6 MB)
#9 3.724 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.6/3.6 MB 7.8 MB/s eta 0:00:00
#9 3.780 Collecting decorator==5.1.1
#9 3.791 Downloading decorator-5.1.1-py3-none-any.whl (9.1 kB)
#9 3.834 Collecting defusedxml==0.7.1
#9 3.847 Downloading defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
#9 3.995 Collecting Django==3.0.6
#9 4.006 Downloading Django-3.0.6-py3-none-any.whl (7.5 MB)
#9 4.961 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.5/7.5 MB 7.8 MB/s eta 0:00:00
#9 5.250 Collecting django-allauth==0.49.0
#9 5.265 Downloading django-allauth-0.49.0.tar.gz (702 kB)
#9 5.365 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 702.3/702.3 KB 7.1 MB/s eta 0:00:00
#9 5.664 Preparing metadata (setup.py): started
#9 6.370 Preparing metadata (setup.py): finished with status 'done'
#9 6.634 Collecting django-crispy-forms==1.14.0
#9 6.646 Downloading django_crispy_forms-1.14.0-py3-none-any.whl (133 kB)
#9 6.673 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.3/133.3 KB 5.6 MB/s eta 0:00:00
#9 6.952 Collecting django-extensions==3.1.5
#9 6.965 Downloading django_extensions-3.1.5-py3-none-any.whl (224 kB)
#9 7.005 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 224.2/224.2 KB 5.9 MB/s eta 0:00:00
#9 7.251 Collecting django-markdownx==3.0.1
#9 7.263 Downloading django_markdownx-3.0.1-py2.py3-none-any.whl (46 kB)
#9 7.283 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.0/46.0 KB 2.3 MB/s eta 0:00:00
#9 7.319 Collecting executing==0.8.2
#9 7.332 Downloading executing-0.8.2-py2.py3-none-any.whl (16 kB)
#9 7.574 Collecting ez-setup==0.9
#9 7.587 Downloading ez_setup-0.9.tar.gz (6.6 kB)
#9 7.602 Preparing metadata (setup.py): started
#9 8.128 Preparing metadata (setup.py): finished with status 'done'
#9 8.184 Collecting gunicorn==20.1.0
#9 8.208 Downloading gunicorn-20.1.0-py3-none-any.whl (79 kB)
#9 8.314 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 79.5/79.5 KB 682.1 kB/s eta 0:00:00
#9 8.354 Collecting idna==3.3
#9 8.367 Downloading idna-3.3-py3-none-any.whl (61 kB)
#9 8.390 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.2/61.2 KB 2.7 MB/s eta 0:00:00
#9 8.502 Collecting importlib-metadata==4.11.2
#9 8.514 Downloading importlib_metadata-4.11.2-py3-none-any.whl (17 kB)
#9 8.631 Collecting ipython==8.0.1
#9 8.647 Downloading ipython-8.0.1-py3-none-any.whl (747 kB)
#9 8.747 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 747.5/747.5 KB 7.6 MB/s eta 0:00:00
#9 8.815 Collecting jedi==0.18.1
#9 8.831 Downloading jedi-0.18.1-py2.py3-none-any.whl (1.6 MB)
#9 9.352 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.6/1.6 MB 3.0 MB/s eta 0:00:00
#9 9.423 Collecting Markdown==3.3.6
#9 9.438 Downloading Markdown-3.3.6-py3-none-any.whl (97 kB)
#9 9.466 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.8/97.8 KB 3.6 MB/s eta 0:00:00
#9 9.500 Collecting matplotlib-inline==0.1.3
#9 9.516 Downloading matplotlib_inline-0.1.3-py3-none-any.whl (8.2 kB)
#9 9.553 Collecting mypy-extensions==0.4.3
#9 9.569 Downloading mypy_extensions-0.4.3-py2.py3-none-any.whl (4.5 kB)
#9 9.620 Collecting oauthlib==3.2.0
#9 9.634 Downloading oauthlib-3.2.0-py3-none-any.whl (151 kB)
#9 9.675 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 151.5/151.5 KB 3.7 MB/s eta 0:00:00
#9 9.718 Collecting parso==0.8.3
#9 9.735 Downloading parso-0.8.3-py2.py3-none-any.whl (100 kB)
#9 9.767 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100.8/100.8 KB 3.3 MB/s eta 0:00:00
#9 9.800 Collecting pathspec==0.9.0
#9 9.815 Downloading pathspec-0.9.0-py2.py3-none-any.whl (31 kB)
#9 9.859 Collecting pickleshare==0.7.5
#9 9.873 Downloading pickleshare-0.7.5-py2.py3-none-any.whl (6.9 kB)
#9 10.64 Collecting Pillow==9.0.1
#9 10.66 Downloading Pillow-9.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB)
#9 11.27 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.3/4.3 MB 7.1 MB/s eta 0:00:00
#9 11.32 Collecting platformdirs==2.5.1
#9 11.33 Downloading platformdirs-2.5.1-py3-none-any.whl (14 kB)
#9 11.42 Collecting prompt-toolkit==3.0.28
#9 11.44 Downloading prompt_toolkit-3.0.28-py3-none-any.whl (380 kB)
#9 11.49 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 380.2/380.2 KB 7.0 MB/s eta 0:00:00
#9 11.62 Collecting psycopg2==2.9.3
#9 11.63 Downloading psycopg2-2.9.3.tar.gz (380 kB)
#9 11.69 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 380.6/380.6 KB 6.4 MB/s eta 0:00:00
#9 11.87 Preparing metadata (setup.py): started
#9 12.47 Preparing metadata (setup.py): finished with status 'error'
#9 12.47 error: subprocess-exited-with-error
#9 12.47
#9 12.47 × python setup.py egg_info did not run successfully.
#9 12.47 │ exit code: 1
#9 12.47 ╰─> [23 lines of output]
#9 12.47 running egg_info
#9 12.47 creating /tmp/pip-pip-egg-info-1er8ezcs/psycopg2.egg-info
#9 12.47 writing /tmp/pip-pip-egg-info-1er8ezcs/psycopg2.egg-info/PKG-INFO
#9 12.47 writing dependency_links to /tmp/pip-pip-egg-info-1er8ezcs/psycopg2.egg-info/dependency_links.txt
#9 12.47 writing top-level names to /tmp/pip-pip-egg-info-1er8ezcs/psycopg2.egg-info/top_level.txt
#9 12.47 writing manifest file '/tmp/pip-pip-egg-info-1er8ezcs/psycopg2.egg-info/SOURCES.txt'
#9 12.47
#9 12.47 Error: pg_config executable not found.
#9 12.47
#9 12.47 pg_config is required to build psycopg2 from source. Please add the directory
#9 12.47 containing pg_config to the $PATH or specify the full executable path with the
#9 12.47 option:
#9 12.47
#9 12.47 python setup.py build_ext --pg-config /path/to/pg_config build ...
#9 12.47
#9 12.47 or with the pg_config option in 'setup.cfg'.
#9 12.47
#9 12.47 If you prefer to avoid building psycopg2 from source, please install the PyPI
#9 12.47 'psycopg2-binary' package instead.
#9 12.47
#9 12.47 For further information please check the 'doc/src/install.rst' file (also at
#9 12.47 <https://www.psycopg.org/docs/install.html>).
#9 12.47
#9 12.47 [end of output]
#9 12.47
#9 12.47 note: This error originates from a subprocess, and is likely not a problem with pip.
#9 12.48 error: metadata-generation-failed
#9 12.48
#9 12.48 × Encountered error while generating package metadata.
#9 12.48 ╰─> See above for output.
#9 12.48
#9 12.48 note: This is an issue with the package mentioned above, not pip.
#9 12.48 hint: See above for details.
------
failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c pip install -r requirements.txt]: exit code: 1
```
그리고 밑에는 현재 제가 작업하고 있는 파일들 내용입니다!!.
```
asgiref==3.5.0
asttokens==2.0.5
backcall==0.2.0
beautifulsoup4==4.10.0
black==22.1.0
certifi==2021.10.8
cffi==1.15.0
charset-normalizer==2.0.12
click==8.0.4
colorama==0.4.4
cryptography==36.0.1
decorator==5.1.1
defusedxml==0.7.1
Django==3.0.6
django-allauth==0.49.0
django-crispy-forms==1.14.0
django-extensions==3.1.5
django-markdownx==3.0.1
executing==0.8.2
ez-setup==0.9
gunicorn==20.1.0
idna==3.3
importlib-metadata==4.11.2
ipython==8.0.1
jedi==0.18.1
Markdown==3.3.6
matplotlib-inline==0.1.3
mypy-extensions==0.4.3
oauthlib==3.2.0
parso==0.8.3
pathspec==0.9.0
pickleshare==0.7.5
Pillow==9.0.1
platformdirs==2.5.1
prompt-toolkit==3.0.28
psycopg2==2.9.3
psycopg2-binary==2.9.3
pure-eval==0.2.2
pycparser==2.21
Pygments==2.11.2
PyJWT==2.3.0
python3-openid==3.2.0
pytz==2021.3
requests==2.27.1
requests-oauthlib==1.3.1
six==1.16.0
soupsieve==2.3.1
sqlparse==0.4.2
stack-data==0.2.0
tomli==2.0.1
traitlets==5.1.1
typing_extensions==4.1.1
urllib3==1.26.8
wcwidth==0.2.5
zipp==3.7.0
```
Dockerfile
```
#pull official base image
FROM python:3.9-slim-buster
#set work directory
WORKDIR /usr/src/app
#set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
COPY . /usr/src/app/
#install dependencies
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
```
docker-compose.yml
```
version: '3'
services:
web:
build: .
command: gunicorn Jusarang_Youth_Web.wsgi:application --bind 0.0.0.0:8000
volumes:
- ./:/usr/src/app/
ports:
- 8000:8000
env_file:
- ./.env.dev
depends_on:
- db
db:
image: postgres:12.0-alpine
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
- POSTGRES_USER=Jusarang_Youth_db_user
- POSTGRES_PASSWORD=Jusarang_Youth_db_password
- POSTGRES_DB=Jusarang_Youth_dev
volumes:
postgres_data:
```
.env.dev
```
DEBUG=1
SECRET_KEY=***************
DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1]
SQL_ENGINE=django.db.backends.postgresql
SQL_DATABASE=Jusarang_Youth_dev
SQL_USER=Jusarang_Youth_db_user
SQL_PASSWORD=Jusarang_Youth_db_password
SQL_HOST=db
SQL_PORT=5432
```
제 컴퓨터는 윈도우 10입니다!! 어느 부분이 문제이고 어떻게 해결해야 하나요?
목록보기
qwefghnm1212 2 years, 8 months ago
아, 해결했습니다
밑에 2개가 있어서, psycopg2부분을 삭제하고 다시 하니 잘 되네요 다행입니다!!
Updated: March 13, 2022, 12:05 a.m.
sungyong 2 years, 8 months ago
Q&A쪽이 아니라...글 올린걸 늦게 봤네요. 해결하셨다니 다행입니다!
Updated: March 17, 2022, 12:04 a.m.
Leave a Comment: