OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

NLTK throws FileNotFoundError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/']

  • Thread starter Thread starter ALTAF HUSSAIN
  • Start date Start date
A

ALTAF HUSSAIN

Guest
Hey can anyone tell what is the reason of FileNotFoundError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/']

I am running on Docker ecs fargate task and this throws error.

I have tried to build and run image on local it works fine but on ecs fargate this throws error.

Below is my docker file

Code:
FROM python:3.10-slim-bullseye
ARG PIP_EXTRA_INDEX_URL
RUN apt-get update \
    && apt-get install --yes build-essential python3-dev default-libmysqlclient-dev libpq-dev pkg-config\
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN groupadd -r runner && useradd -r -g runner runner

COPY requirements /requirements
RUN pip install -U pip
RUN pip install -r requirements/text.txt


COPY handler.py /
COPY document_generation /document_generation

RUN export PYTHONPATH="${PYTHONPATH}:$(pwd)";

USER runner
WORKDIR /

RUN chmod 777 -R /tmp && chmod o+t -R /tmp

CMD ["python", "handler.py"]
<p>Hey can anyone tell what is the reason of <code>FileNotFoundError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/']</code></p>
<p>I am running on Docker ecs fargate task and this throws error.</p>
<p>I have tried to build and run image on local it works fine but on ecs fargate this throws error.</p>
<p>Below is my docker file</p>
<pre><code>FROM python:3.10-slim-bullseye
ARG PIP_EXTRA_INDEX_URL
RUN apt-get update \
&& apt-get install --yes build-essential python3-dev default-libmysqlclient-dev libpq-dev pkg-config\
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN groupadd -r runner && useradd -r -g runner runner

COPY requirements /requirements
RUN pip install -U pip
RUN pip install -r requirements/text.txt


COPY handler.py /
COPY document_generation /document_generation

RUN export PYTHONPATH="${PYTHONPATH}:$(pwd)";

USER runner
WORKDIR /

RUN chmod 777 -R /tmp && chmod o+t -R /tmp

CMD ["python", "handler.py"]

</code></pre>
 
Top