Rasa Core version: 0.13.3
Python version: 3.6.7
Operating system (windows, osx, ...): ubuntu
Issue: Unable to train rasa-core model
$ make train-core
python -m rasa_core.train -d domain.yml -s data/stories.md -o models/current/dialogue -c policies.yml
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/local/lib/python2.7/dist-packages/rasa_core/train.py", line 6, in
from rasa_core import config, cli
File "/usr/local/lib/python2.7/dist-packages/rasa_core/config.py", line 12
def load(config_file: Optional[Text]) -> List['Policy']:
^
SyntaxError: invalid syntax
Makefile:31: recipe for target 'train-core' failed
make: * [train-core] Error 1
Content of domain file (if used & relevant):
domain.yml file -
intents:
- greet
- goodbye
- thanks
- deny
- joke
- name
entities:
- name
slots:
name:
type: text
actions:
- utter_name
- utter_thanks
- utter_greet
- utter_goodbye
- action_joke
templates:
utter_name:
- text: "Hey there! Tell me your name."
utter_greet:
- text: "Nice to you meet you {name}. How can I help?"
utter_goodbye:
- text: "Talk to you later!"
utter_thanks:
- text: "My pleasure."
Thanks for raising this issue, @wochinge will get back to you about it soon.
I have not seen the syntax you have used for the templates. Try changing the syntax to by removing
"- text:"
utter_goodbye:
- "goodbye 馃槩"
- "bye bye 馃槩" # multiple templates - bot will randomly pick one of them
@tahamr83 That's not the issue, the templates are fine, it helps to be more declarative, and my chatbot has used that template since day one without issue.
@mirzahash The issue you're having is due to using Python 2.7, I'd recommend you reinstall with python3 (3.6 works best) and try that make command again. If you look at the error logs, your Python 2.7 installation is being used instead of your 3.6 since the make commands invoke that version.
What I've done to help just prevent that issue from happening in the first place is either alias all python2 commands as python 3 commands in your .bashrc, or just start running the training inside Docker containers, as described here.
Here's what my .bashrc looks like (this is not ideal and I'd _strongly_ recommend using Docker containers):
alias python=python3.6
alias pip=pip3
@ortsaCniveK Thanks a lot!
Can this issue be closed then?
Can this issue be closed then?
Yes, I created a virtual environment and it worked like charm. Thanks, guys!
I'm having this same issue
ruamel.yaml.scanner. ScannerError: while scanning for the next token
found character that cannot start any token
Please, can someone help out?
Python 3.6.10 :: Anaconda, Inc.
ERROR
(python3) C:..........\medicare_locator>make train-core
python3 -m rasa_core.train -d domain.yml -s data/core -o models/current/dialogue -c core_config.yml
make: * [train-core] Error 9009
Most helpful comment
@tahamr83 That's not the issue, the templates are fine, it helps to be more declarative, and my chatbot has used that template since day one without issue.
@mirzahash The issue you're having is due to using Python 2.7, I'd recommend you reinstall with python3 (3.6 works best) and try that
makecommand again. If you look at the error logs, your Python 2.7 installation is being used instead of your 3.6 since themakecommands invoke that version.What I've done to help just prevent that issue from happening in the first place is either alias all python2 commands as python 3 commands in your
.bashrc, or just start running the training inside Docker containers, as described here.Here's what my
.bashrclooks like (this is not ideal and I'd _strongly_ recommend using Docker containers):