from chatterbot.trainers import ListTrainer
from chatterbot import ChatBot
import os.path
import sys
if __name__ == '__main__':
print('me executou pelo terminal')
else:
print('me executou como um módulo')
bot = ChatBot("Sati")
path = os.path.exists("banco.txt")
if path != False:
conv2 = open('banco.txt', 'r').readlines()
bot.set_trainer(ListTrainer)
print("Bot:train Concluido!")
bot.train(conv2)
def textChat(falatext):
frase = str(falatext)
bot_resposta = bot.get_response(frase)
#criar_audio(str(bot_resposta))
print("Bot: "+str(bot_resposta))
while True:
text = input("digite fala: ")
textChat(text)
Aqui esta dando seguinte erro todas vez converto para exe:
475857 INFO: Loading module hook "hook-IPython.py"...
An error occurred while packaging
Traceback (most recent call last):
File "c:\users\2030\appdata\local\programs\python\python36\lib\pkgutil.py", line 490, in find_loader
spec = importlib.util.find_spec(fullname)
File "c:\users\2030\appdata\local\programs\python\python36\lib\importlib\util.py", line 88, in find_spec
parent = __import__(parent_name, fromlist=['__path__'])
File "c:\users\2030\appdata\local\programs\python\python36\lib\site-packages\IPython\__init__.py", line 56, in <module>
from .terminal.embed import embed
File "c:\users\2030\appdata\local\programs\python\python36\lib\site-packages\IPython\terminal\embed.py", line 16, in <module>
from IPython.terminal.interactiveshell import TerminalInteractiveShell
File "c:\users\2030\appdata\local\programs\python\python36\lib\site-packages\IPython\terminal\interactiveshell.py", line 19, in <module>
from prompt_toolkit.enums import DEFAULT_BUFFER, EditingMode
File "c:\users\2030\appdata\local\programs\python\python36\lib\site-packages\prompt_toolkit\__init__.py", line 16, in <module>
from .application import Application
File "c:\users\2030\appdata\local\programs\python\python36\lib\site-packages\prompt_toolkit\application\__init__.py", line 1, in <module>
from .application import Application
File "c:\users\2030\appdata\local\programs\python\python36\lib\site-packages\prompt_toolkit\application\application.py", line 38, in <module>
from prompt_toolkit.buffer import Buffer
File "c:\users\2030\appdata\local\programs\python\python36\lib\site-packages\prompt_toolkit\buffer.py", line 29, in <module>
from .application.run_in_terminal import run_in_terminal
File "c:\users\2030\appdata\local\programs\python\python36\lib\site-packages\prompt_toolkit\application\run_in_terminal.py", line 5, in <module>
from typing import AsyncGenerator, Awaitable, Callable, TypeVar
ImportError: cannot import name 'AsyncGenerator'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "c:\users\2030\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 320, in get_module_file_attribute
loader = pkgutil.find_loader(package)
File "c:\users\2030\appdata\local\programs\python\python36\lib\pkgutil.py", line 496, in find_loader
raise ImportError(msg.format(fullname, type(ex), ex)) from ex
ImportError: Error while finding loader for 'IPython.extensions' (<class 'ImportError'>: cannot import name 'AsyncGenerator')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\2030\appdata\local\programs\python\python36\lib\site-packages\auto_py_to_exe\packaging.py", line 131, in package
run_pyinstaller()
File "c:\users\2030\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\__main__.py", line 114, in run
run_build(pyi_config, spec_file, **vars(args))
File "c:\users\2030\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\__main__.py", line 65, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:\users\2030\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\building\build_main.py", line 734, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "c:\users\2030\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\building\build_main.py", line 681, in build
exec(code, spec_namespace)
File "C:\Users\2030\AppData\Local\Temp\tmpe1ygc1wm\PureChatbot.spec", line 17, in <module>
noarchive=False)
File "c:\users\2030\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\building\build_main.py", line 244, in __init__
self.__postinit__()
File "c:\users\2030\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\building\datastruct.py", line 160, in __postinit__
self.assemble()
File "c:\users\2030\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\building\build_main.py", line 422, in assemble
self.graph.process_post_graph_hooks()
File "c:\users\2030\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\depend\analysis.py", line 311, in process_post_graph_hooks
module_hook.post_graph()
File "c:\users\2030\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\depend\imphook.py", line 417, in post_graph
self._load_hook_module()
File "c:\users\2030\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\depend\imphook.py", line 384, in _load_hook_module
self.hook_module_name, self.hook_filename)
File "c:\users\2030\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\compat.py", line 797, in importlib_load_source
return mod_loader.load_module()
File "<frozen importlib._bootstrap_external>", line 399, in _check_name_wrapper
File "<frozen importlib._bootstrap_external>", line 823, in load_module
File "<frozen importlib._bootstrap_external>", line 682, in load_module
File "<frozen importlib._bootstrap>", line 251, in _load_module_shim
File "<frozen importlib._bootstrap>", line 675, in _load
File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
File "c:\users\2030\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\hooks\hook-IPython.py", line 33, in <module>
datas += collect_data_files('IPython.extensions', include_py_files=True)
File "c:\users\2030\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 723, in collect_data_files
pkg_base, pkg_dir = get_package_paths(package)
File "c:\users\2030\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 537, in get_package_paths
file_attr = get_module_file_attribute(package)
File "c:\users\2030\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 339, in get_module_file_attribute
raise ImportError
ImportError
Project output will not be moved to output folder
Alguém pode me ajudar?