# Nltk resource not found

**URL:** <https://forum.rasa.com/t/nltk-resource-not-found/51517>\
**Category:** \[Deprecated\] Rasa X Community Edition\
**Created:** [February 22, 2022, 5:59pm UTC](https://forum.rasa.com/t/nltk-resource-not-found/51517 "2022-02-22T17:59:08Z")\
**Posts on this page:** 18\
**Page:** 2

<div class="post-metadata">

**Author:** ![pnandhini](https://avatars.discourse-cdn.com/v4/letter/p/85f322/32.png) [@pnandhini](https://forum.rasa.com/u/pnandhini)\
**Post date:** [February 23, 2022, 1:29am UTC](https://forum.rasa.com/t/nltk-resource-not-found/51517/22 "2022-02-23T01:29:25Z")

</div>

Docker compose file:

```auto
version: "3.4"

x-database-credentials: &database-credentials
  DB_HOST: "db"
  DB_PORT: "5432"
  DB_USER: "${DB_USER:-admin}"
  DB_PASSWORD: "${DB_PASSWORD}"
  DB_LOGIN_DB: "${DB_LOGIN_DB:-rasa}"

x-rabbitmq-credentials: &rabbitmq-credentials
  RABBITMQ_HOST: "rabbit"
  RABBITMQ_USERNAME: "user"
  RABBITMQ_PASSWORD: ${RABBITMQ_PASSWORD}

x-redis-credentials: &redis-credentials
  REDIS_HOST: "redis"
  REDIS_PORT: "6379"
  REDIS_PASSWORD: ${REDIS_PASSWORD}
  REDIS_DB: "1"
  REDIS_CACHE_DB: "2"
  ACCEPTABLE_QUERY_COUNT_NUMBER: "50000"
  
x-duckling-credentials: &duckling-credentials
  RASA_DUCKLING_HTTP_URL: "http://duckling:8000"

x-nginx-host-variables: &nginx-host-variables
  RASA_X_HOST: "rasa-x:5002"
  RASA_USER_APP: "app:5055"
  RASA_PRODUCTION_HOST: "rasa-production:5005"

x-rasax-credentials: &rasax-credentials
  RASA_X_HOST: "http://rasa-x:5002"
  RASA_X_USERNAME: ${RASA_X_USERNAME:-admin}
  RASA_X_PASSWORD: ${RASA_X_PASSWORD:-}
  RASA_X_TOKEN: ${RASA_X_TOKEN}
  JWT_SECRET: ${JWT_SECRET}
  RASA_USER_APP: "http://app:5055"
  RASA_PRODUCTION_HOST: "http://rasa-production:5005"
  RASA_WORKER_HOST: "http://rasa-worker:5005"
  RASA_TOKEN: ${RASA_TOKEN}

x-rasa-credentials: &rasa-credentials
  <<: *rabbitmq-credentials
  <<: *rasax-credentials
  <<: *database-credentials
  <<: *redis-credentials
  <<: *duckling-credentials
  RASA_TOKEN: ${RASA_TOKEN}
  RASA_MODEL_PULL_INTERVAL: 10
  RABBITMQ_QUEUE: "rasa_production_events"
  RASA_TELEMETRY_ENABLED: ${RASA_TELEMETRY_ENABLED:-true}

x-rasa-services: &default-rasa-service
  restart: always
  image: "rasa/rasa:${RASA_VERSION}-full"
  volumes:
      - ./.config:/.config
  expose:
    - "5005"
  command: >
    x
    --no-prompt
    --production
    --config-endpoint http://rasa-x:5002/api/config?token=${RASA_X_TOKEN}
    --port 5005
    --jwt-method HS256
    --jwt-secret ${JWT_SECRET}
    --auth-token '${RASA_TOKEN}'
    --cors "*"
  depends_on:
    - rasa-x
    - rabbit
    - redis

services:
  rasa-x:
    restart: always
    image: "rasa/rasa-x:${RASA_X_VERSION}"
    expose:
      - "5002"
    volumes:
      - ./models:/app/models
      - ./environments.yml:/app/environments.yml
      - ./credentials.yml:/app/credentials.yml
      - ./endpoints.yml:/app/endpoints.yml
      - ./logs:/logs
      - ./auth:/app/auth
    environment:
      <<: *database-credentials
      <<: *rasa-credentials
      SELF_PORT: "5002"
      DB_DATABASE: "${DB_DATABASE:-rasa}"
      RASA_MODEL_DIR: "/app/models"
      PASSWORD_SALT: ${PASSWORD_SALT}
      RABBITMQ_QUEUE: "rasa_production_events"
      RASA_X_USER_ANALYTICS: "0"
      SANIC_RESPONSE_TIMEOUT: "3600"
      RUN_DATABASE_MIGRATION_AS_SEPARATE_SERVICE: "true"
    depends_on:
      - db

  db-migration:
    entrypoint: ["python"]
    command: ["-m", "rasax.community.services.db_migration_service"]
    restart: always
    image: "rasa/rasa-x:${RASA_X_VERSION}"
    healthcheck:
      test: ["CMD-SHELL", "curl -f http://localhost:8000/health || kill 1"]
      interval: 5s
      timeout: 1s
      retries: 3
      start_period: 2s
    expose:
      - "8000"
    environment:
      <<: *database-credentials
      RUN_DATABASE_MIGRATION_AS_SEPARATE_SERVICE: "true"
      MPLCONFIGDIR: "/tmp/.matplotlib"
    depends_on:
      - db

  rasa-production:
    <<: *default-rasa-service
    environment:
      <<: *rasa-credentials
      RASA_ENVIRONMENT: "production"
      DB_DATABASE: "tracker"
      MPLCONFIGDIR: "/tmp/.matplotlib"
      RASA_MODEL_SERVER: "http://rasa-x:5002/api/projects/default/models/tags/production"

  rasa-worker:
    <<: *default-rasa-service
    environment:
      <<: *rasa-credentials
      RASA_ENVIRONMENT: "worker"
      DB_DATABASE: "worker_tracker"
      MPLCONFIGDIR: "/tmp/.matplotlib"
      RASA_MODEL_SERVER: "http://rasa-x:5002/api/projects/default/models/tags/production"

  app:
    restart: always
    image: "rasa/rasa-x-demo:${RASA_X_DEMO_VERSION}"
    expose:
      - "5055"
    depends_on:
      - rasa-production

  db:
    restart: always
    image: "bitnami/postgresql:11.11.0"
    expose:
      - "5432"
    environment:
      POSTGRESQL_USERNAME: "${DB_USER:-admin}"
      POSTGRESQL_PASSWORD: "${DB_PASSWORD}"
      POSTGRESQL_DATABASE: "${DB_DATABASE:-rasa}"
    volumes:
      - ./db:/bitnami/postgresql

  rabbit:
    restart: always
    image: "bitnami/rabbitmq:3.8.17"
    environment:
      RABBITMQ_HOST: "rabbit"
      RABBITMQ_USERNAME: "user"
      RABBITMQ_PASSWORD: ${RABBITMQ_PASSWORD}
      RABBITMQ_DISK_FREE_RELATIVE_LIMIT: "0.1"
    expose:
      - "5672"

  duckling:
    restart: always
    image: "rasa/duckling:0.1.6.5-r2"
    expose:
      - "8000"
    command: ["duckling-example-exe", "--no-access-log", "--no-error-log"]

  nginx:
    restart: always
    image: "nginx:1.19"
    ports:
      - "80:8080"
      - "443:8443"
    volumes:
      - ./certs:/etc/certs
      - ./nginx-config-files/nginx.conf:/etc/nginx/nginx.conf
      - ./nginx-config-files/ssl.conf.template:/etc/nginx/templates/ssl.conf.template
      - ./nginx-config-files/rasax.nginx.template:/etc/nginx/templates/rasax.nginx.template
    environment:
      <<: *nginx-host-variables
    depends_on:
      - rasa-x
      - rasa-production
      - app

  redis:
    restart: always
    image: "bitnami/redis:6.2.4"
    environment:
      REDIS_PASSWORD: ${REDIS_PASSWORD}
    expose:
      - "6379"

```

---

<div class="post-metadata">

**Author:** ![pnandhini](https://avatars.discourse-cdn.com/v4/letter/p/85f322/32.png) [@pnandhini](https://forum.rasa.com/u/pnandhini)\
**Post date:** [February 23, 2022, 1:29am UTC](https://forum.rasa.com/t/nltk-resource-not-found/51517/23 "2022-02-23T01:29:59Z")

</div>

Rasa server docker file:

```auto
FROM rasa/rasa:2.8.12-full

USER root

COPY requirements.txt .

RUN pip install --upgrade pip

RUN pip install --no-cache-dir -r requirements.txt

WORKDIR /app

USER 1001

```

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [February 23, 2022, 1:30am UTC](https://forum.rasa.com/t/nltk-resource-not-found/51517/24 "2022-02-23T01:30:23Z")

</div>

@pnandhini share me the reference link from where you seen this? rasa doc?

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [February 23, 2022, 1:31am UTC](https://forum.rasa.com/t/nltk-resource-not-found/51517/25 "2022-02-23T01:31:29Z")

</div>

> [@pnandhini](#):
>
> Docker-compose override:

are you sure its your override file context?

---

<div class="post-metadata">

**Author:** ![pnandhini](https://avatars.discourse-cdn.com/v4/letter/p/85f322/32.png) [@pnandhini](https://forum.rasa.com/u/pnandhini)\
**Post date:** [February 23, 2022, 1:31am UTC](https://forum.rasa.com/t/nltk-resource-not-found/51517/26 "2022-02-23T01:31:55Z")

</div>

Actually this was done by previous developer. I got into this two days back to fix a code issue. I believe he might have used this:

> **[Docker Compose Installation](https://rasa.com/docs/rasa-x/installation-and-setup/install/docker-compose/)**
>
> A tool for Conversation-Driven Development

---

<div class="post-metadata">

**Author:** ![pnandhini](https://avatars.discourse-cdn.com/v4/letter/p/85f322/32.png) [@pnandhini](https://forum.rasa.com/u/pnandhini)\
**Post date:** [February 23, 2022, 1:32am UTC](https://forum.rasa.com/t/nltk-resource-not-found/51517/27 "2022-02-23T01:32:12Z")

</div>

@nik202 yes.

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [February 23, 2022, 1:34am UTC](https://forum.rasa.com/t/nltk-resource-not-found/51517/28 "2022-02-23T01:34:36Z")

</div>

@pnandhini for me it big no, and the actual doc is this one: [Docker Compose Installation](https://rasa.com/docs/rasa-x/0.42.x/installation-and-setup/install/docker-compose) **[update]** @pnandhini

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [February 23, 2022, 1:36am UTC](https://forum.rasa.com/t/nltk-resource-not-found/51517/29 "2022-02-23T01:36:17Z")

</div>

@pnandhini its should only have this one in `docker-compose.override.yml`

```auto
app:
  image: "rasa/action_server:actionserver"
  volumes:
    - "./actions:/app/actions"
    - "./data:/app/data"
  ports:
    - "5055:5055"
  command:
    - rasa run actions

```

Dockerfile in actions folder should be something like this:

```auto
FROM rasa/rasa-sdk:2.8.3

WORKDIR /app

# COPY . /app
COPY actions/requirements.txt ./

COPY ./actions /app/actions
COPY ./data /app/data
COPY __init__.py ./

USER root

RUN pip install -r requirements.txt

RUN ls -l
RUN ls -R

EXPOSE 5055

USER 1001

CMD ["start", "--actions", "actions"]

```

I am confused now, about how your colleague managed to run the code.

@pnandhini confirm me are also using Github actions? FOR CI/CD pipeline?

---

<div class="post-metadata">

**Author:** ![pnandhini](https://avatars.discourse-cdn.com/v4/letter/p/85f322/32.png) [@pnandhini](https://forum.rasa.com/u/pnandhini)\
**Post date:** [February 23, 2022, 1:40am UTC](https://forum.rasa.com/t/nltk-resource-not-found/51517/30 "2022-02-23T01:40:51Z")

</div>

There is no ci/cd pipeline or GitHub actions as far as I could see from the files.

---

<div class="post-metadata">

**Author:** ![pnandhini](https://avatars.discourse-cdn.com/v4/letter/p/85f322/32.png) [@pnandhini](https://forum.rasa.com/u/pnandhini)\
**Post date:** [February 23, 2022, 1:41am UTC](https://forum.rasa.com/t/nltk-resource-not-found/51517/31 "2022-02-23T01:41:22Z")

</div>

@nik202 why? Even When I was trying to down and up the docker compose it was working fine until yesterday evening.

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [February 23, 2022, 1:41am UTC](https://forum.rasa.com/t/nltk-resource-not-found/51517/32 "2022-02-23T01:41:59Z")

</div>

@pnandhini I guess he developed the RASA X from scratch which is not required.

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [February 23, 2022, 1:44am UTC](https://forum.rasa.com/t/nltk-resource-not-found/51517/33 "2022-02-23T01:44:31Z")

</div>

> [@pnandhini](#):
>
> ```auto
> app:
> build: 
> context: actions
> volumes:
> - ./actions:/app/actions
> - ./data:/app/actions/data
> restart: always
> ports:
> - 5055:5055
> command: 'start --actions actions --auto-reload'
> 
> ```

As, I told you it complex impelementation can you mention `user:root` in this file

```auto
app:
    build: 
      context: actions
    user:root
    volumes:
      - ./actions:/app/actions
      - ./data:/app/actions/data
    restart: always
    ports:
      - 5055:5055
    command: 'start --actions actions --auto-reload'

```

```auto

```

---

<div class="post-metadata">

**Author:** ![pnandhini](https://avatars.discourse-cdn.com/v4/letter/p/85f322/32.png) [@pnandhini](https://forum.rasa.com/u/pnandhini)\
**Post date:** [February 23, 2022, 1:46am UTC](https://forum.rasa.com/t/nltk-resource-not-found/51517/35 "2022-02-23T01:46:33Z")

</div>

@nik202 ok. will try adding user in the override file.

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [February 23, 2022, 1:47am UTC](https://forum.rasa.com/t/nltk-resource-not-found/51517/36 "2022-02-23T01:47:13Z")

</div>

@pnandhini also add this in actions.py

```auto
import nltk
nltk.download()

```

Issue is only with nltk not able to download the package, the code installation is really hard to understand and for me some are even not required.

@pnandhini I will get back to you tommorow and till then read the documentation, which I shared.

Pointers:

1. Install rasa x 0.42.4 on ubtunu
2. Create simple action-server image using docker in actions folder with `requirements.txt`
3. create the `docker-compose-override.yml` and mentioned the action-server image
4. docker-compose up -d

that it.

---

<div class="post-metadata">

**Author:** ![pnandhini](https://avatars.discourse-cdn.com/v4/letter/p/85f322/32.png) [@pnandhini](https://forum.rasa.com/u/pnandhini)\
**Post date:** [February 23, 2022, 1:55am UTC](https://forum.rasa.com/t/nltk-resource-not-found/51517/38 "2022-02-23T01:55:26Z")

</div>

@nik202 added this code in actions.py but the same result.

---

<div class="post-metadata">

**Author:** ![pnandhini](https://avatars.discourse-cdn.com/v4/letter/p/85f322/32.png) [@pnandhini](https://forum.rasa.com/u/pnandhini)\
**Post date:** [February 23, 2022, 1:57am UTC](https://forum.rasa.com/t/nltk-resource-not-found/51517/40 "2022-02-23T01:57:16Z")

</div>

can you share you email?

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [February 23, 2022, 3:30am UTC](https://forum.rasa.com/t/nltk-resource-not-found/51517/42 "2022-02-23T03:30:39Z")

</div>

Try mentioned this not together in dockerfile

1. `RUN python -m nltk.downloader punkt`

OR

1. `RUN python -c "import nltk; nltk.download('punkt')"`

Or try downloading the nltk first inside some folder i.e `nltk_data` in the action folder, when import will call it will search the folder.

I wish your issue is soon solved.

---

<div class="post-metadata">

**Author:** ![SharazHaider80](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/sharazhaider80/32/24653_2.png) [@SharazHaider80](https://forum.rasa.com/u/SharazHaider80)\
**Post date:** [October 9, 2024, 6:25am UTC](https://forum.rasa.com/t/nltk-resource-not-found/51517/43 "2024-10-09T06:25:35Z")

</div>

i don’t know if this issue is resolved, but for others use **nltk.download(‘punkt\_tab’);** instead of nltk.download(‘punkt’)

[Previous page](https://forum.rasa.com/t/nltk-resource-not-found/51517.md?page=1)
