Import custom module in


I made an class in a separate python file that I want to use in file. If I import, the action server’s logs say this…

from db_api import db_api ModuleNotFoundError: No module named ‘db_api’

this is my directory structure: -actions - -


Heya!! For example you have file and you have created the class called

def Weather(city): ----your code


Now in

you need to import the file

from weather import Weather

call the class Weather to get the information from

I hope this will clear or if I don’t understand your query please explain with example.

Tip: and should be at same please.If it is a solution tick it :wink: Good Luck!

Hey! Thanks for the response.

I tried that but it won’t work :confused:

I found a workaround though…I typed this: “from . import <myFileName” then I refered to my class using the module name, like this ".

It worked ;p. But the conventional import [eg from weather import Weather] won’t work in

@LastWalkerB Heya!! It’s working or not? Yeah, Rasa updates its version more often, I have given you the idea and concept.

yep it does, thanks.

same here. How do I do it? I have in my actions folder but can’t import it in