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

installation of poetry gives an error. #460

Open
negmatov opened this issue Apr 17, 2022 · 9 comments
Open

installation of poetry gives an error. #460

negmatov opened this issue Apr 17, 2022 · 9 comments

Comments

@negmatov
Copy link

negmatov commented Apr 17, 2022

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://raw.githubusercontent.com/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://raw.githubusercontent.com/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://raw.githubusercontent.com/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

@duz-sg
Copy link

duz-sg commented Jun 23, 2022

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

@robertop23
Copy link

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
Copy link
Author

negmatov commented Aug 31, 2022 via email

@rlziii
Copy link

rlziii commented Sep 1, 2022

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://raw.githubusercontent.com/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

yeger00 added a commit to yeger00/full-stack-fastapi-postgresql that referenced this issue Sep 14, 2022
@realyashnag
Copy link

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

# Install Poetry
RUN curl -sSL https://raw.githubusercontent.com/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://raw.githubusercontent.com/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
Copy link

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

# Install Poetry
RUN curl -sSL https://raw.githubusercontent.com/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://raw.githubusercontent.com/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
Copy link

robertop23 commented Jul 11, 2023 via email

@lamegaton
Copy link

lamegaton commented Aug 27, 2023

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
Copy link

samanehmoradilgr commented Oct 12, 2023

-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

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

8 participants