Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

541
Views
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 answers
Answer question

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 Report

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!