'charmap' codec can't encode character '\u01b0' in position

when I run the command

rasa run actions --actions actions rasa interactive -m models/20190515-135859.tar.gz --endpoints endpoints.yml there is an error

UnicodeEncodeError: ‘charmap’ codec can’t encode character ‘\u01b0’ in position 1441: character maps to

I try to run

set PYTHONIOENCODING=‘utf8’

but i doesn’t work

what version of python and rasa are you using?

python 3.7.3 and Rasa 1.1.6

can you tell me the alternative for

export PYTHONPATH=/path_to_your_project_dir/:$PYTHONPATH

in window ? When i cd to another Rasa project to run, the command line keeps showing the errors related to the previous project

Hi @TQuy,

Are you sure you encoded your endpoints.yml in utf-8 when you saved it?

I am not sure, I just copy it from Rasa example and save it in my folder, not sure how to encode it in utf-8 endpoints.yml (1.4 KB)

Can you post the full stacktrace please?

I run

rasa run actions

on other window

Hi @TQuy,

I think this is a Windows-related bug. Could you try running rasa interactive with the --skip-visualization flag and let me know if you still encounter this error?

It fixes the problem. However, I have a new one for you :wink: I face it when run the command rasa interactive -m models/20190515-135859.tar.gz --endpoints endpoints.yml and chat 1 message

my stories file is :

happy hoi_phi_giao_hang

  • greet
    • utter_greet
  • hoi_phi_giao_hang
    • price_form
    • form{“name”: “price_form”}
    • form{“name”: null}
    • utter_tinh_phi_giao_hang
  • thank
    • utter_thank
    • utter_additional_help
  • deny
    • utter_thank

very unhappy hoi_phi_giao_hang

  • hoi_phi_giao_hang
    • price_form
    • form{“name”: “price_form”}
  • chitchat
    • utter_chitchat
    • price_form
  • chitchat
    • utter_chitchat
    • price_form
  • chitchat
    • utter_chitchat_2
    • price_form
    • form{“name”: null}
    • utter_tinh_phi_giao_hang
  • thank
    • utter_thank

stop but continue hoi_phi_giao_hang

  • greet
    • utter_greet
  • hoi_phi_giao_hang
    • price_form
    • form{“name”: “price_form”}
  • deny
    • utter_ask_continue
  • affirm
    • price_form
    • form{“name”: null}
    • utter_tinh_phi_giao_hang
  • thank
    • utter_thank

stop and really stop path

  • greet
    • utter_greet
  • hoi_phi_giao_hang
    • price_form
    • form{“name”: “price_form”}
  • deny
    • utter_ask_continue
  • deny
    • action_deactivate_form
    • form{“name”: null}

chitchat stop but continue path

  • hoi_phi_giao_hang
    • price_form
    • form{“name”: “price_form”}
  • chitchat
    • utter_chitchat
    • price_form
  • deny
    • utter_ask_continue
  • affirm
    • price_form
    • form{“name”: null}
    • utter_tinh_phi_giao_hang
  • thank
    • utter_thank
    • utter_additional_help
  • deny
    • utter_goodbye

stop but continue and chitchat path

  • greet
    • utter_greet
  • hoi_phi_giao_hang
    • price_form
    • form{“name”: “price_form”}
  • deny
    • utter_ask_continue
  • affirm
    • price_form
  • chitchat
    • utter_chitchat
    • price_form
    • form{“name”: null}
    • utter_tinh_phi_giao_hang
  • thank
    • utter_thank

buu_cuc_gan_nhat

  • buu_cuc_gan_nhat{“local_address”: “an lão hải phòng”}
    • utter_buu_cuc_gan_nhat
    • utter_additional_help
  • deny OR thank
    • utter_goodbye

buu_cuc_gan_nhat

  • buu_cuc_gan_nhat{“local_address”: “tp vinh”}
    • utter_buu_cuc_gan_nhat
    • utter_additional_help
  • dang_ki
    • utter_dang_ki
    • utter_additional_help
  • deny
    • utter_goodbye

buu_cuc_gan_nhat

  • buu_cuc_gan_nhat{“local_address”: “hà nội”}
    • utter_buu_cuc_gan_nhat
    • utter_additional_help
  • dang_ki
    • utter_dang_ki
    • utter_additional_help
  • deny
    • utter_goodbye

buu_cuc_gan_nhat

  • buu_cuc_gan_nhat{“local_address”: “hưng yên”}
    • utter_buu_cuc_gan_nhat
    • utter_additional_help
  • affirm
    • utter_help

dang_ki

  • dang_ki
    • utter_dang_ki
    • utter_additional_help
  • deny
    • utter_goodbye

kiem_tra_don happypath 1

  • greet
    • utter_greet
  • kiem_tra_don{“order_code”: “12380081”}
    • utter_kiem_tra_don
    • utter_additional_help
  • deny OR thank
    • utter_goodbye

kiem_tra_don and chitchat2

  • kiem_tra_don{“order_code”: “225730139”}
    • utter_kiem_tra_don
  • utter_additional_help
  • chitchat
    • utter_chitchat
  • chitchat
    • utter_chitchat_2
  • swearing
    • utter_thank
    • utter_goodbye

kiem_tra_don+giuc_giao_hang

  • kiem_tra_don{“order_code”: “123545564n”}
    • utter_kiem_tra_don
    • utter_additional_help
  • giuc_giao_hang
    • utter_giuc_giao_hang
    • utter_additional_help
  • deny
    • utter_thank

my config.yml file is

language: vi

pipeline:

  • name: “nlu.tokenizers.whitespace_tokenizer.WhitespaceTokenizer”
  • name: “RegexFeaturizer”
  • name: “CRFEntityExtractor”
  • name: “EntitySynonymMapper”
  • name: “CountVectorsFeaturizer” analyzer: ‘char’ min_df: 1 max_df: 1.0 min_ngram: 1 max_ngram: 5
  • name: “EmbeddingIntentClassifier” “epochs”: 10

policies:

  • name: FallbackPolicy
  • name: MemoizationPolicy
  • name: KerasPolicy “epochs”: 10
  • name: FormPolicy
  • name: MappingPolicy

my action file is

-- coding: utf-8 --

from typing import Dict, Text, Any, List, Union, Optional

from rasa_sdk import Tracker, Action from rasa_sdk.executor import CollectingDispatcher from rasa_sdk.forms import FormAction

class PriceForm(FormAction): def name(self) → Text: “”“Unique identifier of the form”“”

    return "price_form"

@staticmethod
def required_slots(tracker:Tracker) -> List[Text]:
    """A list of required slots that the form has to fill"""

    return ["from_address", "destination_address", "weight"]

def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict]]]:
    """A dictionary to map required slots to
        - an extracted entity
        - intent: value pairs
        - a whole message
        or a list of them, where a first match will be picked
     """
    return {
    "from_address": self.from_entity(entity= "from_address", intent = "hoi_phi_giao_hang"),
    "destination_address": self.from_entity(entity= "destination_address", intent = "hoi_phi_giao_hang"),
    "weight": self.from_entity(entity= "weight", intent = "hoi_phi_giao_hang"), 
    }

# USED FOR DOCS: do not rename without updating in docs
def validate_weight(
    self,
    value: Text,
    dispatcher: CollectingDispatcher,
    tracker: Tracker,
    domain: Dict[Text, Any],
) -> Optional[Text]:
    """Validate cuisine value."""

    return {"weight": value}

def validate_from_address(
    self,
    value: Text,
    dispatcher: CollectingDispatcher,
    tracker: Tracker,
    domain: Dict[Text, Any],
) -> Optional[Text]:
    """Validate cuisine value."""
    
    return {"from_address": value}

def validate_destination_address(
    self,
    value: Text,
    dispatcher: CollectingDispatcher,
    tracker: Tracker,
    domain: Dict[Text, Any],
) -> Optional[Text]:
    """Validate cuisine value."""
    
    return {"destination_address": value}

def submit(
    self,
    dispatcher: CollectingDispatcher,
    tracker: Tracker,
    domain: Dict[Text, Any],
) -> List[Dict]:
    """Define what the form has to do after all required slots are filled """
    # utter submit template
    dispatcher.utter_template("utter_submit", tracker)
    return []

I got the same encoding problem, can you share how you did ?