# Issue of actions.py do not know get\_weather in rasa x

**URL:** https://forum.rasa.com/t/issue-of-actions-py-do-not-know-get-weather-in-rasa-x/11396
**Category:** Rasa Open Source
**Created:** [June 12, 2019, 8:37pm UTC](https://forum.rasa.com/t/issue-of-actions-py-do-not-know-get-weather-in-rasa-x/11396 "2019-06-12T20:37:13Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![hajoura](https://avatars.discourse-cdn.com/v4/letter/h/5f8ce5/32.png) [@hajoura](https://forum.rasa.com/u/hajoura)
#### Post date: [June 12, 2019, 8:37pm UTC](https://forum.rasa.com/t/issue-of-actions-py-do-not-know-get-weather-in-rasa-x/11396/1 "2019-06-12T20:37:13Z")

</div>

my nlu.md contains

## intent:greeting

- hey

- hello

- hi

- heya

## intent:how\_are\_you

- how are you

- how is it going

- how is life

## intent:bye

- bye

- good bye

## intent:my\_name\_is

- I am Martin

- I am Jack

- I’m Steven

- im Jack

- My name is Martin Novak

## intent:get\_weather

- what’s the weather

- what’s the weather in Czech Republic

- what is the weather

- what is the weather in New Zealand

- whats the weather

## synonym:Prague

- Czech Republic

- Czechia

- CR

- CZ

## synonym:Auckland

- New Zealand

- NZ

- Zealand my stories.md

## greeting

- greeting
  - utter\_greeting

## how are you

- how\_are\_you
  - utter\_how\_i\_am

## good bye

- bye
  - utter\_bye

## my name is

- my\_name\_is
  - utter\_its\_nice\_to\_meet\_you

## dialogue about myself

- who\_are\_you
  - utter\_introduction

- tell\_me\_more
  - utter\_more\_personal\_information

## dialogue about turtles

- do\_you\_like\_turtles
  - utter\_i\_love\_turtles

- tell\_me\_more
  - utter\_list\_of\_favorite\_turtles

## get weather

- get\_weather
  - action\_get\_weather my config file anguage: en

pipeline:

- name: nlp\_spacy

- name: tokenizer\_spacy

- name: intent\_entity\_featurizer\_regex

- name: intent\_featurizer\_spacy

- name: ner\_crf

- name: ner\_spacy

- name: ner\_synonyms

- name: intent\_classifier\_sklearn

policies:

- batch\_size: 50

epochs: 200

max\_training\_samples: 300

name: KerasPolicy

- fallback\_action\_name: action\_default\_fallback

name: FallbackPolicy

- max\_history: 5

name: MemoizationPolicy

- name: FormPolicy

- name: MappingPolicy my actions.py from **future** import absolute\_import from **future** import division from **future** import print\_function from **future** import unicode\_literals

from rasa\_core.actions.action import Action

# [weather-api · PyPI](https://pypi.org/project/weather-api/)

from weather import Weather, Unit

class ActionGetWeather(Action): def name(self): return ‘action\_get\_weather’

```
def run(self, dispatcher, tracker, domain):
    weather = Weather(unit=Unit.CELSIUS)
    gpe = ('Auckland', tracker.get_slot('GPE'))[bool(tracker.get_slot('GPE'))]
    result = weather.lookup_by_location(gpe)
    if result:
        condition = result.condition
        city = result.location.city
        country = result.location.country
        dispatcher.utter_message('It\'s ' + condition.text + ' and ' + condition.temp + '°C in ' +
                                 city + ', ' + country + '.')
    else:
        dispatcher.utter_message('We did not find any weather information for ' + gpe + '. Search by a city name.')
    return

```

when I run rasa train Cannot access action ‘action\_get\_weather’, as that name is not a registered action for this domain. Available actions are: - action\_listen - action\_restart - action\_default\_fallback - action\_deactivate\_form - action\_revert\_fallback\_events - action\_default\_ask\_affirmation - action\_default\_ask\_rephrase - action\_back - actions.weather.ActionGetWeather - utter\_bye - utter\_greeting - utter\_how\_i\_am - utter\_its\_nice\_to\_meet\_you

---

_[View the full topic](https://forum.rasa.com/t/issue-of-actions-py-do-not-know-get-weather-in-rasa-x/11396)._
