pkg_resources.DistributionNotFound: The 'rasa' distribution was not found and is required by the application

I’ve run docker-compose up and got that error from the title.

My docker-compose file:

version: '3'

services:

  rasa:

    image: rasa/rasa:latest-full

    networks: ['rasa-network']

    ports:

      - 5005:5005

    volumes:

      - ./:/app

    command:

      - run

      - -m

      - models

      - --enable-api

      - --cors

      - "*"

      - --endpoints

      - endpoints.yml

  action_server:

    image: rasa/rasa-sdk:latest

    networks: ['rasa-network']

    volumes:

      - ./actions:/app/actions

  db:

    container_name: postgres

    image: postgres:latest

    networks: ['rasa-network']

    ports: 

      - "5432:5432"

    restart: always

    environment:

      - POSTGRES_USER=postgres

      - POSTGRES_PASSWORD=pw

      - POSTGRES_DB=postgres

    volumes:

      - ./postgres-data:/var/lib/postgresql/data

   
networks: {rasa-network: {}}

I have been getting the same error. I tried to run to create a docker by using the command

docker run -v $(pwd):/app rasa/rasa init --no-prompt

I got the following error

Traceback (most recent call last):
  File "/opt/venv/bin/rasa", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/opt/venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3253, in <module>
    @_call_aside
  File "/opt/venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3237, in _call_aside
    f(*args, **kwargs)
  File "/opt/venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3266, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/opt/venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 584, in _build_master
    ws.require(__requires__)
  File "/opt/venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 901, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/opt/venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 787, in resolve
    raise DistributionNotFound(req, requirers)

**pkg_resources.DistributionNotFound: The 'rasa' distribution was not found and is required by the application**

Does anyone by chance have a solution for this? I would appreciate it much.

I have the same problem

I haven’t managed to solve this yet too.

Anyone?

I got it working, I just removed all the local docker containers of rasa/rasa present and run

docker run -v $(pwd):/app rasa/rasa init --no-prompt again.

Use docker remove <image_id|image_name>

Good luck.

1 Like