Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NotImplementedError: typ "['safe', 'rt']"not recognised (need to install plug-in?) #7320

Closed
huseyin01 opened this issue Nov 20, 2020 · 21 comments
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework status:more-details-needed Waiting for the user to provide more details / stacktraces / answer a question type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. type:dependencies Pull requests that update a dependency file

Comments

@huseyin01
Copy link

Rasa version:
rasa==2.0.2

Rasa SDK version (if used & relevant):
rasa-sdk==2.1.2

Rasa X version (if used & relevant):
rasa-x==0.33.2

Python version:
Python 3.7.6

Operating system (windows, osx, ...):
mac os

Issue:

I tried to train my package (which I had no issue with training with the previous version) with rasa 2, but I am receiving below error.

Error (including full traceback):

Traceback (most recent call last):
  File "/Users/hy/Downloads/PMC-senol/env/bin/rasa", line 8, in <module>
    sys.exit(main())
  File "/Users/hy/Downloads/PMC-senol/env/lib/python3.7/site-packages/rasa/__main__.py", line 115, in main
    cmdline_arguments.func(cmdline_arguments)
  File "/Users/hy/Downloads/PMC-senol/env/lib/python3.7/site-packages/rasa/cli/train.py", line 90, in train
    nlu_additional_arguments=extract_nlu_additional_arguments(args),
  File "/Users/hy/Downloads/PMC-senol/env/lib/python3.7/site-packages/rasa/train.py", line 55, in train
    loop,
  File "/Users/hy/Downloads/PMC-senol/env/lib/python3.7/site-packages/rasa/utils/common.py", line 308, in run_in_loop
    result = loop.run_until_complete(f)
  File "uvloop/loop.pyx", line 1456, in uvloop.loop.Loop.run_until_complete
  File "/Users/hy/Downloads/PMC-senol/env/lib/python3.7/site-packages/rasa/train.py", line 95, in train_async
    domain = await file_importer.get_domain()
  File "/Users/hy/Downloads/PMC-senol/env/lib/python3.7/site-packages/rasa/shared/utils/common.py", line 119, in decorated
    return await cache.cached_result()
  File "/Users/hy/Downloads/PMC-senol/env/lib/python3.7/site-packages/rasa/shared/importers/importer.py", line 441, in get_domain
    self.importer.get_domain(), self._get_domain_with_e2e_actions()
  File "/Users/hy/Downloads/PMC-senol/env/lib/python3.7/site-packages/rasa/shared/importers/importer.py", line 448, in _get_domain_with_e2e_actions
    stories = await self.get_stories()
  File "/Users/hy/Downloads/PMC-senol/env/lib/python3.7/site-packages/rasa/shared/importers/importer.py", line 474, in get_stories
    template_variables, use_e2e, exclusion_percentage
  File "/Users/hy/Downloads/PMC-senol/env/lib/python3.7/site-packages/rasa/shared/importers/importer.py", line 396, in get_stories
    template_variables, use_e2e, exclusion_percentage
  File "/Users/hy/Downloads/PMC-senol/env/lib/python3.7/site-packages/rasa/shared/utils/common.py", line 119, in decorated
    return await cache.cached_result()
  File "/Users/hy/Downloads/PMC-senol/env/lib/python3.7/site-packages/rasa/shared/importers/importer.py", line 280, in get_stories
    stories = await asyncio.gather(*stories)
  File "/Users/hy/Downloads/PMC-senol/env/lib/python3.7/site-packages/rasa/shared/importers/rasa.py", line 51, in get_stories
    await self.get_domain(),
  File "/Users/hy/Downloads/PMC-senol/env/lib/python3.7/site-packages/rasa/shared/importers/rasa.py", line 67, in get_domain
    domain = Domain.load(self._domain_path)
  File "/Users/hy/Downloads/PMC-senol/env/lib/python3.7/site-packages/rasa/shared/core/domain.py", line 121, in load
    other = cls.from_path(path)
  File "/Users/hy/Downloads/PMC-senol/env/lib/python3.7/site-packages/rasa/shared/core/domain.py", line 131, in from_path
    domain = cls.from_file(path)
  File "/Users/hy/Downloads/PMC-senol/env/lib/python3.7/site-packages/rasa/shared/core/domain.py", line 144, in from_file
    return cls.from_yaml(rasa.shared.utils.io.read_file(path), path)
  File "/Users/hy/Downloads/PMC-senol/env/lib/python3.7/site-packages/rasa/shared/core/domain.py", line 150, in from_yaml
    yaml, rasa.shared.constants.DOMAIN_SCHEMA_FILE
  File "/Users/hy/Downloads/PMC-senol/env/lib/python3.7/site-packages/rasa/shared/utils/validation.py", line 140, in validate_yaml_schema
    yaml_file_content, reader_type=["safe", "rt"]
  File "/Users/hy/Downloads/PMC-senol/env/lib/python3.7/site-packages/rasa/shared/utils/io.py", line 256, in read_yaml
    yaml_parser = yaml.YAML(typ=reader_type)
  File "/Users/hy/Downloads/PMC-senol/env/lib/python3.7/site-packages/ruamel/yaml/main.py", line 138, in __init__
    'typ "{}"not recognised (need to install plug-in?)'.format(self.typ)
NotImplementedError: typ "['safe', 'rt']"not recognised (need to install plug-in?)

Command or request that led to error:

rasa train

Content of configuration file (config.yml) (if relevant):

Content of domain file (domain.yml) (if relevant):

@huseyin01 huseyin01 added area:rasa-oss 🎡 Anything related to the open source Rasa framework type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. labels Nov 20, 2020
@sara-tagger
Copy link
Collaborator

Thanks for the issue, @TyDunn will get back to you about it soon!

You may find help in the docs and the forum, too 🤗

@TyDunn
Copy link
Contributor

TyDunn commented Nov 23, 2020

Hi @huseyin01. Can you share your config.yml file please?

@huseyin01
Copy link
Author

Hi @TyDunn,
Sure, here is my config.yml

language: en
pipeline:
- name: SpacyNLP
- name: SpacyTokenizer
- name: CountVectorsFeaturizer
- name: RegexFeaturizer
- name: DucklingEntityExtractor
  url: http://localhost:8000
  dimensions:
  - time
- name: DIETClassifier
  epochs: 70
  random_seed: 2
- name: EntitySynonymMapper
- name: FallbackClassifier
  threshold: 0.5
  ambiguity_threshold: 0.1
policies:
- name: MemoizationPolicy
  max_history: 5
- name: TEDPolicy
  max_history: 5
  epochs: 70
- name: RulePolicy
  core_fallback_threshold: 0.3
  core_fallback_action_name: action_my_fallback

@TyDunn
Copy link
Contributor

TyDunn commented Nov 23, 2020

@huseyin01 Thanks. That looks okay to me. Can you share your domain.yml file?

@huseyin01
Copy link
Author

Here it is,

session_config:
  session_expiration_time: 60
  carry_over_slots_to_new_session: true
intents:
- greet
- goodbye
- ask_workload
- thank
- deny
- affirm
- ask_urgent
- ask_project_details    # I have +19 intents
entities:
- workload
- urgency
- project  # I have +25 entities
slots:
  PERSON:
    type: any
    influence_conversation: false
  days:
    type: any
    influence_conversation: false
  due_date:
    type: any
    influence_conversation: false   # I have +24 slot with "type:any" and "influence..: false" 
responses:
  utter_how_can_I_help:
  - text: Welcome. How can I help you today?
  utter_goodbye:
  - text: It was a pleasure for me!    # +18 more utterance

actions:
- utter_how_can_I_help
- utter_goodbye
- utter_thank
- utter_fallback    # +30 actions

forms:
  form_create_risk:
    new_risk:
    - entity: inform
      type: from_text

@kalkbrennerei
Copy link
Contributor

Hi @huseyin01! Can you share your ruamel.yaml version please?
You can check the ruamel version by pip show ruamel.yaml

I think this is related to #7047 which was actually supposed to be fixed in rasa 2.0.2 by increasing the minimum ruamel version.

@huseyin01
Copy link
Author

Hi @kalkbrennerei ,
here are the versions;

ruamel.yaml==0.15.100
ruamel.yaml.clib==0.2.2

@kalkbrennerei
Copy link
Contributor

@huseyin01 okay, seems like you're having some issues with your dependencies. Maybe you can create a new virtual environment and install rasa from scratch. Doing that should automatically install a compatible version of ruamel.yaml

Please let me know if that helps!

@huseyin01
Copy link
Author

Hi @kalkbrennerei ,
I already installed rasa in a brand new virtual environment on the day that I opened this issue, and I didn't specify any version name for rasa. the installed version for RASA was 2, and all its dependencies were installed automatically. So, do you mean after installation rasa, should I reinstall "ruamel.yaml" with a specific version name?

@kalkbrennerei
Copy link
Contributor

Hi @huseyin01, pip3 install ruamel.yaml==0.16.10 should also get it to work, but it's still weird that the dependencies were not installed correctly when you installed rasa.

I am unfortunately also unable to reproduce this locally and still curious why this happens. So can you please check your version of rasa again?

@huseyin01
Copy link
Author

Hi @kalkbrennerei ,

My rasa version is rasa==2.0.2

@stefanvantchev
Copy link

Same here... how come installing rasa from scratch on brand new machine doesn't work??

@TyDunn
Copy link
Contributor

TyDunn commented Jan 6, 2021

@stefanvantchev Did you install it in a new virtual environment? Can you please create a new issue for your problem, where you detail the versions you are using, operating system, what error you are running into, etc?

@stefanvantchev
Copy link

Everything is brand new using GCP VMs.

What I have learned about Rasa during the last 3 months of struggles is that I cannot rely on it executing the same way between my tests, so I decide to always use a new VM for each new test... so yes... new install, new everything.

@alwx alwx added the type:dependencies Pull requests that update a dependency file label Jan 28, 2021
@m-vdb m-vdb added the status:more-details-needed Waiting for the user to provide more details / stacktraces / answer a question label Mar 12, 2021
@no-response
Copy link

no-response bot commented Mar 26, 2021

This issue has been automatically closed because there has been no response to our request for more information from the original author. Without this, we don't have enough information to help you. Please comment below with the requested information if you still need help.

@no-response no-response bot closed this as completed Mar 26, 2021
@rahmahemden
Copy link

i'm facing same issue ! can someone plz help me i have to fix it ! it was working fine last night !!
raise NotImplementedError(
NotImplementedError: typ "['safe', 'rt']"not recognised (need to install plug-in?)

@kalkbrennerei
Copy link
Contributor

Hi @rahmahemden! Which rasa version are you using?

@rahmahemden
Copy link

hey,
2.5.0

@rahmahemden
Copy link

well , i just upgraded to 2.6.0 and it worked, i don't understand why that happened ?
thank you

@tjjohn
Copy link

tjjohn commented May 29, 2021

its the error related to rasa x

@rahmahemden
Copy link

well in fact i'm not able to download rasa x , i'v tried pip3 install rasa-x --extra-index-url https://pypi.rasa.com/simple , and got few errors,
Building wheel for ujson (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\asus\desktop\internship\rasa\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\asus\AppData\Local\Temp\pip-install-40345y14\ujson\setup.py'"'"'; file='"'"'C:\Users\asus\AppData\Local\Temp\pip-install-40345y14\ujson\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\asus\AppData\Local\Temp\pip-wheel-dn4z556x'
cwd: C:\Users\asus\AppData\Local\Temp\pip-install-40345y14\ujson
Complete output (6 lines):
Warning: 'classifiers' should be a list, got type 'filter'
running bdist_wheel
running build
running build_ext
building 'ujson' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/

ERROR: Failed building wheel for ujson
Running setup.py clean for ujson
Failed to build ujson
DEPRECATION: Could not build wheels for ujson which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at pypa/pip#8368.
Installing collected packages: ruamel.yaml.clib, ruamel.yaml, kafka-python, ujson, rasa-x, pyjwt
Attempting uninstall: kafka-python
Found existing installation: kafka-python 2.0.2
Uninstalling kafka-python-2.0.2:
Successfully uninstalled kafka-python-2.0.2
Attempting uninstall: ujson
Found existing installation: ujson 3.2.0
Uninstalling ujson-3.2.0:
Successfully uninstalled ujson-3.2.0
Running setup.py install for ujson ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\asus\desktop\internship\rasa\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\asus\AppData\Local\Temp\pip-install-40345y14\ujson\setup.py'"'"'; file='"'"'C:\Users\asus\AppData\Local\Temp\pip-install-40345y14\ujson\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\asus\AppData\Local\Temp\pip-record-x0vgncwu\install-record.txt' --single-version-externally-managed --compile
--install-headers 'c:\users\asus\desktop\internship\rasa\include\site\python3.8\ujson'
cwd: C:\Users\asus\AppData\Local\Temp\pip-install-40345y14\ujson
Complete output (6 lines):
Warning: 'classifiers' should be a list, got type 'filter'
running install
running build
running build_ext
building 'ujson' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\asus\desktop\internship\rasa\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\asus\AppData\Local\Temp\pip-install-40345y14\ujson\setup.py'"'"'; file='"'"'C:\Users\asus\AppData\Local\Temp\pip-install-40345y14\ujson\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file,
'"'"'exec'"'"'))' install --record 'C:\Users\asus\AppData\Local\Temp\pip-record-x0vgncwu\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\asus\desktop\internship\rasa\include\site\python3.8\ujson' Check the logs for full command output.

how do i fix this please !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework status:more-details-needed Waiting for the user to provide more details / stacktraces / answer a question type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. type:dependencies Pull requests that update a dependency file
Projects
None yet
Development

No branches or pull requests

9 participants