Python RASA - 导入时出错 "object() takes no parameters" "from rasa_core.agent import Agent"
Python RASA - Error "object() takes no parameters" while importing "from rasa_core.agent import Agent"
导入命令:
"from rasa_core.agent import Agent"
出现以下错误
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-43-bdf78c35345b> in <module>()
5 from rasa_core import training
6 from rasa_core.actions import Action
----> 7 from rasa_core.agent import Agent
8 from rasa_core.domain import Domain
9 from rasa_core.policies.keras_policy import KerasPolicy
C:\ProgramData\Miniconda3\lib\site-packages\rasa_core\agent.py in <module>()
15 import rasa_core
16 from rasa_core import training, constants
---> 17 from rasa_core.channels import UserMessage, OutputChannel, InputChannel
18 from rasa_core.constants import DEFAULT_REQUEST_TIMEOUT
19 from rasa_core.dispatcher import Dispatcher
C:\ProgramData\Miniconda3\lib\site-packages\rasa_core\channels\__init__.py in <module>()
15 from rasa_core.channels.botframework import BotFrameworkInput # nopep8
16 from rasa_core.channels.callback import CallbackInput # nopep8
---> 17 from rasa_core.channels.console import CmdlineInput # nopep8
18 from rasa_core.channels.facebook import FacebookInput # nopep8
19 from rasa_core.channels.mattermost import MattermostInput # nopep8
C:\ProgramData\Miniconda3\lib\site-packages\rasa_core\channels\console.py in <module>()
1 # this builtin is needed so we can overwrite in test
----> 2 import questionary
3
4 import json
5 import requests
C:\ProgramData\Miniconda3\lib\site-packages\questionary\__init__.py in <module>()
3
4 import questionary.version
----> 5 from questionary.form import Form
6 from questionary.form import form
7 from questionary.prompt import prompt
C:\ProgramData\Miniconda3\lib\site-packages\questionary\form.py in <module>()
1 from collections import namedtuple
2
----> 3 from questionary.constants import DEFAULT_KBI_MESSAGE
4 from questionary.question import Question
5
C:\ProgramData\Miniconda3\lib\site-packages\questionary\constants.py in <module>()
38 ('selected', ''), # style for a selected item of a checkbox
39 ('separator', ''), # separator in lists
---> 40 ('instruction', '') # user instructions for select, rawselect, checkbox
41 ])
TypeError: object() takes no parameters
此错误也出现在其他一些 Rasa 导入中。
以下是我的版本:
Python - 3.6.6
rasa_core - 0.13.3
rasa_nlu- 0.14.4
有一项要求 list 可在线获得,但发布的答案导致错误仍未解决。
感谢任何帮助。
我遇到过类似的问题。
安装以下版本的库应该可以解决错误:
- python==3.6.7
- rasa_core==0.9.6
- rasa_nlu==0.14.4
- spacy==2.0.18
- pandas==0.22.0
- sklearn_crfsuite== 0.3.6
干杯!
编辑:确保在安装上述内容时创建新的 python 环境以避免相互依赖性问题。
导入命令:
"from rasa_core.agent import Agent"
出现以下错误
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-43-bdf78c35345b> in <module>()
5 from rasa_core import training
6 from rasa_core.actions import Action
----> 7 from rasa_core.agent import Agent
8 from rasa_core.domain import Domain
9 from rasa_core.policies.keras_policy import KerasPolicy
C:\ProgramData\Miniconda3\lib\site-packages\rasa_core\agent.py in <module>()
15 import rasa_core
16 from rasa_core import training, constants
---> 17 from rasa_core.channels import UserMessage, OutputChannel, InputChannel
18 from rasa_core.constants import DEFAULT_REQUEST_TIMEOUT
19 from rasa_core.dispatcher import Dispatcher
C:\ProgramData\Miniconda3\lib\site-packages\rasa_core\channels\__init__.py in <module>()
15 from rasa_core.channels.botframework import BotFrameworkInput # nopep8
16 from rasa_core.channels.callback import CallbackInput # nopep8
---> 17 from rasa_core.channels.console import CmdlineInput # nopep8
18 from rasa_core.channels.facebook import FacebookInput # nopep8
19 from rasa_core.channels.mattermost import MattermostInput # nopep8
C:\ProgramData\Miniconda3\lib\site-packages\rasa_core\channels\console.py in <module>()
1 # this builtin is needed so we can overwrite in test
----> 2 import questionary
3
4 import json
5 import requests
C:\ProgramData\Miniconda3\lib\site-packages\questionary\__init__.py in <module>()
3
4 import questionary.version
----> 5 from questionary.form import Form
6 from questionary.form import form
7 from questionary.prompt import prompt
C:\ProgramData\Miniconda3\lib\site-packages\questionary\form.py in <module>()
1 from collections import namedtuple
2
----> 3 from questionary.constants import DEFAULT_KBI_MESSAGE
4 from questionary.question import Question
5
C:\ProgramData\Miniconda3\lib\site-packages\questionary\constants.py in <module>()
38 ('selected', ''), # style for a selected item of a checkbox
39 ('separator', ''), # separator in lists
---> 40 ('instruction', '') # user instructions for select, rawselect, checkbox
41 ])
TypeError: object() takes no parameters
此错误也出现在其他一些 Rasa 导入中。
以下是我的版本:
Python - 3.6.6 rasa_core - 0.13.3 rasa_nlu- 0.14.4
有一项要求 list 可在线获得,但发布的答案导致错误仍未解决。
感谢任何帮助。
我遇到过类似的问题。
安装以下版本的库应该可以解决错误:
- python==3.6.7
- rasa_core==0.9.6
- rasa_nlu==0.14.4
- spacy==2.0.18
- pandas==0.22.0
- sklearn_crfsuite== 0.3.6
干杯!
编辑:确保在安装上述内容时创建新的 python 环境以避免相互依赖性问题。