I am trying to make a chatbot with Chatterbot, Python.
I have the following code.
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
chatbot = ChatBot('Ron Obvious')
trainer = ChatterBotCorpusTrainer(chatbot)
trainer.train("chatterbot.corpus.english")
r = chatbot.get_response("Hello, how are you today?")
print(r)
When ever I run it, it shows me the following error message.
ai.yml Training: [ ] 1%Traceback (most recent call last):
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in <module>
start(fakepyfile,mainpyfile)
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start
exec(open(mainpyfile).read(), __main__.__dict__)
File "<string>", line 7, in <module>
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/chatterbot/trainers.py", line 159, in train
statement = self.get_or_create(text)
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/chatterbot/trainers.py", line 48, in get_or_create
statement = self.storage.find(temp_statement.text)
AttributeError: 'ChatBot' object has no attribute 'find'
How to fix this?
Related
i bought a rapberry pi 4 to code, i know is not the best platform, but recently my computer got stolen and its all i can afford right know.
im trying to get vpython to run.
these is the code that im trying to run
import vpython
ball=vpython.sphere()
while True:
pass
but it gives me these error.
Traceback (most recent call last):
File "/home/maviles/Documents/py-course/Vputhon/vppython.py", line 2, in <module>
ball=vpython.sphere()
File "/home/maviles/.local/lib/python3.9/site-packages/vpython/vpython.py", line 1172, in __init__
super(sphere, self).setup(args)
File "/home/maviles/.local/lib/python3.9/site-packages/vpython/vpython.py", line 599, in setup
super(standardAttributes, self).__init__()
File "/home/maviles/.local/lib/python3.9/site-packages/vpython/vpython.py", line 259, in __init__
from .no_notebook import _
File "/home/maviles/.local/lib/python3.9/site-packages/vpython/no_notebook.py", line 12, in <module>
from autobahn.asyncio.websocket import WebSocketServerProtocol, WebSocketServerFactory
File "/home/maviles/.local/lib/python3.9/site-packages/autobahn/asyncio/__init__.py", line 32, in <module>
from autobahn.asyncio.websocket import \
File "/home/maviles/.local/lib/python3.9/site-packages/autobahn/asyncio/websocket.py", line 36, in <module>
from autobahn.util import public, hltype
File "/home/maviles/.local/lib/python3.9/site-packages/autobahn/util.py", line 49, in <module>
from OpenSSL import SSL
File "/usr/lib/python3/dist-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import crypto, SSL
File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1556, in <module>
class X509StoreFlags(object):
File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1577, in X509StoreFlags
CB_ISSUER_CHECK = _lib.X509_V_FLAG_CB_ISSUER_CHECK
AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'
exit
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/home/maviles/.local/lib/python3.9/site-packages/vpython/vpython.py", line 22, in Exit
a = 1.0/zero
ZeroDivisionError: float division by zero
Exception ignored in: <function standardAttributes.__del__ at 0x7f93664550>
Traceback (most recent call last):
File "/home/maviles/.local/lib/python3.9/site-packages/vpython/vpython.py", line 1159, in __del__
super(standardAttributes, self).__del__()
File "/home/maviles/.local/lib/python3.9/site-packages/vpython/vpython.py", line 340, in __del__
cmd = {"cmd": "delete", "idx": self.idx}
AttributeError: 'sphere' object has no attribute 'idx'
please help.
i could not find anything on these topic for the raspberry 4b
i try to run the code and expec it to open a window with a sphere
I am learning and building a chatterbot with Python. I start with writing a simple chattbox. When I run the code, it errors out.
I am using Python 3.8.5, chatterbot 1.0.4 and Atom IDE
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
chatbot = ChatBot('Javis')
trainer = ChatterBotCorpusTrainer(chatbot)
trainer.train("chatterbot.corpus.english")
response = chatbot.get_response("Hello, how are you today?")
print(response)
When I run the code on Atom platformio-ide-terminal, it throws an error
Traceback (most recent call last):
File "chatbot.py", line 4, in <module>
chatbot = ChatBot('Bon')
File "C:\Python\Python38-32\lib\site-packages\chatterbot\chatterbot.py", line 34, in __init__
self.storage = utils.initialize_class(storage_adapter, **kwargs)
File "C:\Python\Python38-32\lib\site-packages\chatterbot\utils.py", line 54, in initialize_class
return Class(*args, **kwargs)
File "C:\Python\Python38-32\lib\site-packages\chatterbot\storage\sql_storage.py", line 22, in __init__
from sqlalchemy import create_engine
File "C:\Python\Python38-32\lib\site-packages\sqlalchemy\__init__.py", line 8, in <module>
from . import util as _util # noqa
File "C:\Python\Python38-32\lib\site-packages\sqlalchemy\util\__init__.py", line 14, in <module>
from ._collections import coerce_generator_arg # noqa
File "C:\Python\Python38-32\lib\site-packages\sqlalchemy\util\_collections.py", line 16, in <module>
from .compat import binary_types
File "C:\Python\Python38-32\lib\site-packages\sqlalchemy\util\compat.py", line 264, in <module>
time_func = time.clock
AttributeError: module 'time' has no attribute 'clock'
The function time.clock is deprecated since 3.3 version of python. Please check here for reference AttributeError: module 'time' has no attribute 'clock' in Python 3.8 , might be useful.
im having so many troubles setup pyswip library and there is not solution inside the repository issues.
I have:
Python : 3.7.3
Swipl: 8.0.3
Always getting this error message.
Please enter you SWI-Prolog version in format "X.Y.Z": 8.0.3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/enzoftware/Projects/github-curious/pyswiptest/pyswip_env/lib/python3.7/site-packages/pyswip/__init__.py", line 29, in <module>
from pyswip.prolog import Prolog
File "/Users/enzoftware/Projects/github-curious/pyswiptest/pyswip_env/lib/python3.7/site-packages/pyswip/prolog.py", line 28, in <module>
from pyswip.core import *
File "/Users/enzoftware/Projects/github-curious/pyswiptest/pyswip_env/lib/python3.7/site-packages/pyswip/core.py", line 568, in <module>
(_path, SWI_HOME_DIR) = _findSwipl()
File "/Users/enzoftware/Projects/github-curious/pyswiptest/pyswip_env/lib/python3.7/site-packages/pyswip/core.py", line 420, in _findSwipl
(path, swiHome) = _findSwiplMacOSHome()
File "/Users/enzoftware/Projects/github-curious/pyswiptest/pyswip_env/lib/python3.7/site-packages/pyswip/core.py", line 342, in _findSwiplMacOSHome
swi_ver = get_swi_ver()
File "/Users/enzoftware/Projects/github-curious/pyswiptest/pyswip_env/lib/python3.7/site-packages/pyswip/core.py", line 310, in get_swi_ver
match = re.search(r'[0-9]\.[0-9]\.[0-9]')
TypeError: search() missing 1 required positional argument: 'string'
I have installed box2d using pip install but when I run OpenAI gym environment for box2d games with python. In my case I am trying to run LunarLander environment:-
import gym
env = gym.make("LunarLander-v2")
env.reset()
I get this error:
[2018-01-02 01:37:39,026] Making new env: LunarLander-v2
Traceback (most recent call last):
File "ens.py", line 13, in <module>env = gym.make(a)
File "/home/yograj/gym/gym/envs/registration.py", line 164, in make
return registry.make(id)
File "/home/yograj/gym/gym/envs/registration.py", line 122, in make
env = spec.make()
File "/home/yograj/gym/gym/envs/registration.py", line 88, in make cls
= load(self._entry_point)
File "/home/yograj/gym/gym/envs/registration.py", line 17, in load
result = entry_point.load(False)
File "/home/yograj/anaconda2/lib/python2.7/site-packages/setuptools-
27.2.0-py2.7.egg/pkg_resources/__init__.py", line 2258, in load
File "/home/yograj/anaconda2/lib/python2.7/site-packages/setuptools-
27.2.0-py2.7.egg/pkg_resources/__init__.py", line 2264, in resolve
File "/home/yograj/gym/gym/envs/box2d/__init__.py", line 1, in
<module>from gym.envs.box2d.lunar_lander import LunarLander
File "/home/yograj/gym/gym/envs/box2d/lunar_lander.py", line 4, in
<module> import Box2D File "/home/yograj/anaconda2/lib/python2.7/site
packages/Box2D/__init__.py", line 20, in <module>from .Box2D import *
File
"/home/yograj/anaconda2/lib/python2.7/sitepackages/Box2D/Box2D.py",
line 434, in <module> RAND_LIMIT = _Box2D.RAND_LIMIT
AttributeError: 'module' object has no attribute 'RAND_LIMIT'
I'm new to Python and I'm trying to do a simple thread as follows.
import threading
def func(x):
print x
t1 = threading.Thread(target=func,args=("Hello",));
t1.start();
Then I got following error:
Traceback (most recent call last):
File "ex2.py", line 1, in <module>
import threading
File "/Users/treinetic-macbook/Desktop/threading.py", line 2, in <module>
File "/Library/Python/2.7/site-packages/requests/__init__.py", line 43, in <module>
import urllib3
File "/Library/Python/2.7/site-packages/urllib3/__init__.py", line 8, in <module>
from .connectionpool import (
File "/Library/Python/2.7/site-packages/urllib3/connectionpool.py", line 3, in <module>
import logging
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 207, in <module>
_lock = threading.RLock()
AttributeError: 'module' object has no attribute 'RLock'
can someone help me to understand this error?
/Users/treinetic-macbook/Desktop/threading.py is being imported because it's on your path somewhere. This is most likely not correct, try renaming that file and removing any threading.pyc file in your local dir.