Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. # Poetry 홈페이지: https://python-poetry.org/ ## Install <code> curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - </code> ## Setting 프로젝트 폴더에 가상환경을 추가하기 위한 설정 <code> poetry config virtualenvs.in-project true </code> ## Docs - [[docker poetry]] - [[poetry config]] ### poetry update 실패시 [[pip]] upgrade 실행 <code> pip install --upgrade pip </code> ## requirements.txt <code> cat requirements.txt|xargs poetry add </code> <code sh> poetry config experimental.new-installer false </code> ## 패키지 추가시 <code> poetry add [package name] </code> ## apt-get install python3-venv ## 기존 프로젝트에서 옮기는 경우 - https://github.com/sdispater/poetry/issues/46 <code shell> % poetry init % poetry add `cat requirements.txt` apt-get install python3-venv poetry self:update --preview poetry env use python3.7 https://www.itsupportwale.com/blog/how-to-upgrade-to-python-3-7-on-ubuntu-18-10/ sudo apt-get install python3.7-venv </code> ## ERROR ### httptools/parser/parser.c:4:10: fatal error: Python.h: No such file or directory - https://stackoverflow.com/questions/21530577/fatal-error-python-h-no-such-file-or-directory For apt (Ubuntu, Debian...): <code shell> sudo apt-get install python-dev # for python2.x installs sudo apt-get install python3-dev # for python3.x installs </code> ## 설정 - https://poetry.eustace.io/docs/configuration/ <code shell> poetry config virtualenvs.in-project true </code> - https://github.com/sdispater/poetry/issues/108 ### ERROR ``` [ValueError] Setting virtualenvs.in-project does not exist ``` 해결 ``` poetry config settings.virtualenvs.in-project true ``` ## Integrating Python Poetry with Docker - https://stackoverflow.com/questions/53835198/integrating-python-poetry-with-docker <code docker> FROM python:3.6.6-alpine3.7 ARG YOUR_ENV ENV YOUR_ENV=${YOUR_ENV} \ PYTHONFAULTHANDLER=1 \ PYTHONUNBUFFERED=1 \ PYTHONHASHSEED=random \ PIP_NO_CACHE_DIR=off \ PIP_DISABLE_PIP_VERSION_CHECK=on \ PIP_DEFAULT_TIMEOUT=100 \ POETRY_VERSION=0.12.11 # System deps: RUN pip install "poetry==$POETRY_VERSION" # Copy only requirements to cache them in docker layer WORKDIR /code COPY poetry.lock pyproject.toml /code/ # Project initialization: RUN poetry config settings.virtualenvs.create false \ && poetry install $(test "$YOUR_ENV" == production && echo "--no-dev") --no-interaction --no-ansi # Creating folders, and files for a project: COPY . /code </code> ### Error - [[python setup.py bdist_wheel did not run successfully]] open/poetry.txt Last modified: 2024/10/05 06:15by 127.0.0.1