Skip to content

installation of poetry gives an error. #460

Open
@negmatov

Description

@negmatov

Good afternoon. I wanted to ask about full-stack-fastapi-postgresql for several weeks now I can’t deploy, I went through several steps in windows 10 and docker is the latest version and stuck in the installation of poetry gives an error. (
Building backend
[+] Building 321.5s (7/11)
=> [internal] load build definition from backend.dockerfile 0.0s
=> => transferring dockerfile: 40B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/tiangolo/uvicorn-gunicorn-fastapi:python3.7 11.4s
=> [internal] load build context 0.1s
=> => transferring context: 4.37kB 0.1s
=> [1/7] FROM docker.io/tiangolo/uvicorn-gunicorn-fastapi:python3.7@sha256:f5770422a8875fe3d677e1bda724eeba332b53b0a348a9cdde854ba7136c66be 0.0s
=> CACHED [2/7] WORKDIR /app/ 0.0s
=> ERROR [3/7] RUN curl -sSL https://github.com/raw/python-poetry/poetry/master/get-poetry.py | POETRY_HOME=/opt/poetry python && cd /usr/local/bin && ln -s /opt/poetry/bin/poetry && poetry config 309.9s

[3/7] RUN curl -sSL https://github.com/raw/python-poetry/poetry/master/get-poetry.py | POETRY_HOME=/opt/poetry python && cd /usr/local/bin && ln -s /opt/poetry/bin/poetry && poetry config virtualenvs.crea
te false:
#6 309.8 Retrieving Poetry metadata
#6 309.8 Traceback (most recent call last):
#6 309.8 File "/usr/local/lib/python3.7/urllib/request.py", line 1350, in do_open
#6 309.8 encode_chunked=req.has_header('Transfer-encoding'))
#6 309.8 File "/usr/local/lib/python3.7/http/client.py", line 1281, in request
#6 309.8 self._send_request(method, url, body, headers, encode_chunked)
#6 309.8 File "/usr/local/lib/python3.7/http/client.py", line 1327, in _send_request
#6 309.8 self.endheaders(body, encode_chunked=encode_chunked)
#6 309.8 File "/usr/local/lib/python3.7/http/client.py", line 1276, in endheaders
#6 309.8 self._send_output(message_body, encode_chunked=encode_chunked)
#6 309.8 File "/usr/local/lib/python3.7/http/client.py", line 1036, in _send_output
#6 309.8 self.send(msg)
#6 309.8 File "/usr/local/lib/python3.7/http/client.py", line 976, in send
#6 309.8 self.connect()
#6 309.8 File "/usr/local/lib/python3.7/http/client.py", line 1451, in connect
#6 309.8 server_hostname=server_hostname)
#6 309.8 File "/usr/local/lib/python3.7/ssl.py", line 423, in wrap_socket
#6 309.8 session=session
#6 309.8 File "/usr/local/lib/python3.7/ssl.py", line 870, in _create
#6 309.8 self.do_handshake()
#6 309.8 File "/usr/local/lib/python3.7/ssl.py", line 1139, in do_handshake
#6 309.8 self._sslobj.do_handshake()
#6 309.8 OSError: [Errno 0] Error
#6 309.8
#6 309.8 During handling of the above exception, another exception occurred:
#6 309.8
#6 309.8 Traceback (most recent call last):
#6 309.8 File "", line 1118, in
#6 309.8 File "", line 1114, in main
#6 309.8 File "", line 352, in run
#6 309.8 File "", line 415, in get_version
#6 309.8 File "", line 1029, in _get
#6 309.8 File "/usr/local/lib/python3.7/urllib/request.py", line 222, in urlopen
#6 309.8 return opener.open(url, data, timeout)
#6 309.8 File "/usr/local/lib/python3.7/urllib/request.py", line 525, in open
#6 309.8 response = self._open(req, data)
#6 309.8 File "/usr/local/lib/python3.7/urllib/request.py", line 543, in _open
#6 309.8 '_open', req)
#6 309.8 File "/usr/local/lib/python3.7/urllib/request.py", line 503, in _call_chain
#6 309.8 result = func(*args)
#6 309.8 File "/usr/local/lib/python3.7/urllib/request.py", line 1393, in https_open
#6 309.8 context=self._context, check_hostname=self._check_hostname)
#6 309.8 File "/usr/local/lib/python3.7/urllib/request.py", line 1352, in do_open
#6 309.8 raise URLError(err)
#6 309.8 urllib.error.URLError: <urlopen error [Errno 0] Error>


executor failed running [/bin/sh -c curl -sSL https://github.com/raw/python-poetry/poetry/master/get-poetry.py | POETRY_HOME=/opt/poetry python && cd /usr/local/bin && ln -s /opt/poetry/bin/poetry && poetry
config virtualenvs.create false]: exit code: 1
ERROR: Service 'backend' failed to build : Build failed

I searched for an answer on the Internet and unfortunately did not find similar solutions to problems. In parallel, in macbookpro macOS 10.12.6, it also fails to deploy, it gives an error (

Bahrom-MacBook-Pro:edoru negmatov$ docker-compose up -d
ERROR: Invalid interpolation format for "networks" option in service "flower": "${TRAEFIK_PUBLIC_NETWORK?Variable not set}"
)
Docker 17.03.1 is installed in macOS. I ask you to direct me to the correct solution of the error.
Visual Studio Code Version: 1.65.2 (Universal)
Thanks for the help

Activity

duz-sg

duz-sg commented on Jun 23, 2022

@duz-sg

They had some breaking changes so you can try an old version:
https://github.com/raw/python-poetry/poetry/1.1/get-poetry.py |

robertop23

robertop23 commented on Aug 31, 2022

@robertop23

The poetry install process should be updated.

Files backend.dockerfile and celeryworker.dockerfile:

# Install Poetry RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python3 - ENV PATH="/opt/poetry/bin:$PATH" RUN poetry config virtualenvs.create false

negmatov

negmatov commented on Aug 31, 2022

@negmatov
Author
rlziii

rlziii commented on Sep 1, 2022

@rlziii

To add some clarity to @robertop23's answer (which worked for me):

In both backend/backend.dockerfile and backend/celeryworker.dockerfile replace the following code blocks:

# Install Poetry
RUN curl -sSL https://github.com/raw/python-poetry/poetry/master/get-poetry.py | POETRY_HOME=/opt/poetry python3 && \
    cd /usr/local/bin && \
    ln -s /opt/poetry/bin/poetry && \
    poetry config virtualenvs.create false

With the following:

# Install Poetry 
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python3
ENV PATH="/opt/poetry/bin:$PATH"
RUN poetry config virtualenvs.create false
added a commit that references this issue on Sep 14, 2022
realyashnag

realyashnag commented on Dec 1, 2022

@realyashnag

@rlziii 's solution works, the following snippet looks even cleaner.
Replace

# Install Poetry
RUN curl -sSL https://github.com/raw/python-poetry/poetry/master/get-poetry.py | POETRY_HOME=/opt/poetry python && \
    cd /usr/local/bin && \
    ln -s /opt/poetry/bin/poetry && \
    poetry config virtualenvs.create false

in /backend.dockerfile and celeryworker.dockerfile to

# Install Poetry
RUN curl -sSL https://github.com/raw/python-poetry/poetry/master/install-poetry.py | POETRY_HOME=/opt/poetry python && \
    cd /usr/local/bin && \
    ln -s /opt/poetry/bin/poetry && \
    poetry config virtualenvs.create false
prithviraj574

prithviraj574 commented on Jul 11, 2023

@prithviraj574

@rlziii 's solution works, the following snippet looks even cleaner. Replace

# Install Poetry
RUN curl -sSL https://github.com/raw/python-poetry/poetry/master/get-poetry.py | POETRY_HOME=/opt/poetry python && \
    cd /usr/local/bin && \
    ln -s /opt/poetry/bin/poetry && \
    poetry config virtualenvs.create false

in /backend.dockerfile and celeryworker.dockerfile to

# Install Poetry
RUN curl -sSL https://github.com/raw/python-poetry/poetry/master/install-poetry.py | POETRY_HOME=/opt/poetry python && \
    cd /usr/local/bin && \
    ln -s /opt/poetry/bin/poetry && \
    poetry config virtualenvs.create false

This is not working currently

robertop23

robertop23 commented on Jul 11, 2023

@robertop23
lamegaton

lamegaton commented on Aug 27, 2023

@lamegaton

The latest Poetry version (1.6.1) drops support for python 3.7, so if we want to use tiangolo/uvicorn-gunicorn-fastapi:python3.7, we need to edit

# Install Poetry
    RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry POETRY_VERSION=1.5.1 python  && \
    cd /usr/local/bin && \
    ln -s /opt/poetry/bin/poetry && \
    poetry config virtualenvs.create false
samanehmoradilgr

samanehmoradilgr commented on Oct 12, 2023

@samanehmoradilgr

-Getting Peotry error for using https://github.com/tiangolo/full-stack-fastapi-postgresql

So, check VPN(for connection from Iran) and then replace below code to backend.dockerfile and celeryworker.dockerfile:

#Install Poetry
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry POETRY_VERSION=1.5.1 python &&
cd /usr/local/bin &&
ln -s /opt/poetry/bin/poetry &&
poetry config virtualenvs.create false

karthikrajgopal

karthikrajgopal commented on Jul 16, 2024

@karthikrajgopal

I was able to solve this issue with installing directly from pip:

# Install system dependencies
RUN apt-get update && apt-get install -y \
    curl \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

# Install Poetry using pip
RUN pip install --no-cache-dir poetry==1.5.1 && \
    poetry config virtualenvs.create false
    

If someone confirms if it works for them too, I will raise a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @robertop23@lamegaton@duz-sg@prithviraj574@rlziii

        Issue actions

          installation of poetry gives an error. · Issue #460 · fastapi/full-stack-fastapi-template