Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

542
Visualizações
Docker: Download all from nltk in Dockerfile

How would I achieve the following in a Dockerfile:

sudo python
import nltk
nltk.download('all')
about 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

You can build a custom Docker image with everything you need:

FROM python:3.6-slim
RUN pip3 install nltk
RUN [ "python", "-c", "import nltk; nltk.download('all')" ]
ENTRYPOINT python

Then build:

docker build -t docker-nltk .

And run:

docker run -it docker-nltk
about 4 years ago · Santiago Trujillo Relatório

0

If you add your code to the file downloadall.py this Dockerfile does the job on my machine:

FROM python:3
RUN pip install nltk
ADD downloadall.py /
CMD [ "python", "./downloadall.py" ]

Let me know if it works for you!

about 4 years ago · Santiago Trujillo Relatório

0

This is how to do it properly:

FROM python:3.7

RUN pip install nltk
RUN python -m nltk.downloader all

...rest of Dockerfile...
about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda