# Rasa X Docker Tarinning ModuleNotFoundError with a Custom Component

**URL:** <https://forum.rasa.com/t/rasa-x-docker-tarinning-modulenotfounderror-with-a-custom-component/44240>\
**Category:** \[Deprecated\] Rasa X Community Edition\
**Created:** [June 3, 2021, 8:05am UTC](https://forum.rasa.com/t/rasa-x-docker-tarinning-modulenotfounderror-with-a-custom-component/44240 "2021-06-03T08:05:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lynndisco](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/lynndisco/32/15165_2.png) [@lynndisco](https://forum.rasa.com/u/lynndisco)\
**Post date:** [June 3, 2021, 8:05am UTC](https://forum.rasa.com/t/rasa-x-docker-tarinning-modulenotfounderror-with-a-custom-component/44240/1 "2021-06-03T08:05:23Z")

</div>

versions : [rasa-x : 0.40.1] [rasa : 2.6.2]

Hello.

I installed the RasaX as instructed by [[Docker Compose Installation](https://rasa.com/docs/rasa-x/installation-and-setup/install/docker-compose)] ,and pulled code from a remote git repository.

The custom component is in `rasa-x` : /app/git/2/compoments/

`config.yml`:

```
pipeline:
- name: compoments.nlu.tokenizers.bert_tokenizer.CustomBertTokenizer
    cache_dir: ./tmp
    model_weights: pre_models
- name: LanguageModelFeaturizer
    cache_dir: ./tmp
    model_name: bert
    model_weights: pre_models
- name: DIETClassifier
    epochs: 100
    constrain_similarities: True
    model_confidence: linear_norm
- name: RegexEntityExtractor
- name: EntitySynonymMapper
- name: ResponseSelector
    epochs: 100
    retrieval_intent: rasa_faq
- name: FallbackClassifier
    threshold: 0.3
    ambiguity_threshold: 0.1

```

When I training a model, `rasa-worker` throws a sequence of errors:

```
Traceback (most recent call last):
File "/opt/venv/lib/python3.8/site-packages/rasa/server.py", line 1055, in train
    training_result = await train_async(**training_payload)
File "/opt/venv/lib/python3.8/site-packages/rasa/model_training.py", line 108, in train_async
    return await _train_async_internal(
File "/opt/venv/lib/python3.8/site-packages/rasa/model_training.py", line 289, in _train_async_internal
    await _do_training(
File "/opt/venv/lib/python3.8/site-packages/rasa/model_training.py", line 335, in _do_training
    model_path = await _train_nlu_with_validated_data(
File "/opt/venv/lib/python3.8/site-packages/rasa/model_training.py", line 759, in _train_nlu_with_validated_data
    await rasa.nlu.train.train(
File "/opt/venv/lib/python3.8/site-packages/rasa/nlu/train.py", line 97, in train
    trainer = Trainer(
File "/opt/venv/lib/python3.8/site-packages/rasa/nlu/model.py", line 162, in __init__
    components.validate_requirements(cfg.component_names)
File "/opt/venv/lib/python3.8/site-packages/rasa/nlu/components.py", line 70, in validate_requirements
    component_class = registry.get_component_class(component_name)
File "/opt/venv/lib/python3.8/site-packages/rasa/nlu/registry.py", line 148, in get_component_class
    raise ComponentNotFoundException(
rasa.nlu.registry.ComponentNotFoundException: Failed to load the component 'compoments.nlu.tokenizers.bert_tokenizer.CustomBertTokenizer'. Failed to find module 'compoments.nlu.tokenizers.bert_tokenizer'. Either your pipeline configuration contains an error or the module you are trying to import is broken (e.g. the module is trying to import a package that is not installed). Traceback (most recent call last):
File "/opt/venv/lib/python3.8/site-packages/rasa/nlu/registry.py", line 121, in get_component_class
    return rasa.shared.utils.common.class_from_module_path(component_name)
File "/opt/venv/lib/python3.8/site-packages/rasa/shared/utils/common.py", line 37, in class_from_module_path
    m = importlib.import_module(module_name)
File "/usr/lib/python3.8/importlib/ __init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'compoments'

```

How can I load the custom component during pipeline execution, or do I need to mount it in advance? Thanks.

---

<div class="post-metadata">

**Author:** ![kalkbrennerei](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/kalkbrennerei/32/11609_2.png) [@kalkbrennerei](https://forum.rasa.com/u/kalkbrennerei)\
**Post date:** [June 9, 2021, 9:14am UTC](https://forum.rasa.com/t/rasa-x-docker-tarinning-modulenotfounderror-with-a-custom-component/44240/2 "2021-06-09T09:14:42Z")

</div>

Hi @lynndisco! I haven’t tried it myself, but I saw this [forum thread](http://forum.rasa.com/t/rasa-x-custom-pipline-element/29310) with an example for how to include the custom component in the docker-compose file. Let me know if this works for you or if you need more help!

---

<div class="post-metadata">

**Author:** ![lynndisco](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/lynndisco/32/15165_2.png) [@lynndisco](https://forum.rasa.com/u/lynndisco)\
**Post date:** [June 11, 2021, 7:34am UTC](https://forum.rasa.com/t/rasa-x-docker-tarinning-modulenotfounderror-with-a-custom-component/44240/3 "2021-06-11T07:34:14Z")

</div>

It’s works for me , thanks !
