Open feekee opened 6 years ago
the python version is 3.6.0 I don't know whether affect it
I'm facing the same problem and have searched for hours. But I can't solve it, still
@chamkank Thank you. That might prove helpful in tracking down the cause.
I am trapped in this problem in a virtualenv environment, while it can run without error with macos system python3.
@chamkank How to install ver. 0.7.4? I am facing this issue in latest ver 0.8.7 of chatterbot
@mohitatgithub pip install --upgrade chatterbot==0.7.4
I'm going to close this ticket off. ChatterBot's SQL Storage adapter now has relatively proficient test coverage and I believe the issue that had caused this error has been fixed.
@gunthercox the issue is still there.. I just needed to downgrade to v, 0.7.4 to make the library work.
@giovannipiccinelli Can you post any steps or instructions that I can use to recreate this error?
I am using pythonanywhere python 3.6 and the error thrown looks similar to the one posted by Feekee at the top.
The ChatBot object does not get initialized for some reasons. Amazing library by the way 👍
i too had the same issue, downgrading it to 0.7.4 solved the issue.
I am running the following code with latest version and encountered the same problem. from chatterbot.trainers import ListTrainer from chatterbot import ChatBot
chatbot = ChatBot("Ron Obvious", storage_adapter='chatterbot.storage.SQLStorageAdapter', database_uri='sqlite:///database.sqlite3' ) conversation = [ "Hello", "Hi there!", "How are you doing?", "I'm doing great.", "That is good to hear", "Thank you.", "You're welcome." ]
trainer = ListTrainer(chatbot) trainer.train(conversation) response = chatbot.get_response("good morning") print(response)
So downloaded to 0.7.4 version as per the comments. Now I get the following error:
Traceback (most recent call last):
File "/Users/Prasanna/PycharmProjects/VMesgBot/sandbox/samples.py", line 17, in
So I updated chatbot to latest version and changed the sqladapter to mongodb. Everything works fine. I think the problem is with sqlite.
1.0.2
Traceback (most recent call last): File "C:\Users\qcjxb\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\engine\base.py", line 2228, in _wrap_pool_connect return fn() File "C:\Users\qcjxb\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\pool.py", line 434, in connect return _ConnectionFairy._checkout(self) File "C:\Users\qcjxb\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\pool.py", line 831, in _checkout fairy = _ConnectionRecord.checkout(pool) File "C:\Users\qcjxb\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\pool.py", line 563, in checkout rec = pool._do_get() File "C:\Users\qcjxb\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\pool.py", line 1355, in _do_get return self._create_connection() File "C:\Users\qcjxb\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\pool.py", line 379, in _create_connection return _ConnectionRecord(self) File "C:\Users\qcjxb\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\pool.py", line 508, in init self.connect(first_connect_check=True) File "C:\Users\qcjxb\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\pool.py", line 722, in connect pool.dispatch.connect(self.connection, self) File "C:\Users\qcjxb\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\event\attr.py", line 259, in call fn(*args, **kw) File "C:\Users\qcjxb\AppData\Local\Programs\Python\Python36\lib\site-packages\chatterbot\storage\sql_storage.py", line 43, in set_sqlite_pragma dbapi_connection.execute('PRAGMA journal_mode=WAL') sqlite3.OperationalError: cannot change into wal mode from within a transaction
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "d:\program files (x86)\microsoft visual studio\2019\preview\common7\ide\extensions\microsoft\python\core\ptvsd_launcher.py", line 119, in
I am trying to implement a chatterbot chatbot (corpus trainer) and having same issue. So I had to install chatterbot version 0.7.4 but then I got an "Attribute error", it says ChatBot has no attribute 'find'. I search many places and found that I need to increase the version of chatterbot. I update it to 1.0.2 but again I'm getting this error. :") Any suggestion?
ChatterBot 0.74 works fine!!!
Guys this issue is open for so long, and I think there is no solution here Having the same error
Traceback (most recent call last):
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\engine\base.py", line 2336, in _wrap_pool_connect
return fn()
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\pool\base.py", line 364, in connect
return _ConnectionFairy._checkout(self)
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\pool\base.py", line 778, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\pool\base.py", line 495, in checkout
rec = pool._do_get()
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\pool\impl.py", line 241, in _do_get
return self._create_connection()
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\pool\base.py", line 309, in _create_connection
return _ConnectionRecord(self)
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\pool\base.py", line 440, in __init__
self.__connect(first_connect_check=True)
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\pool\base.py", line 668, in __connect
pool.dispatch.connect(self.connection, self)
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\event\attr.py", line 261, in __call__
fn(*args, **kw)
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\chatterbot\storage\sql_storage.py", line 43, in set_sqlite_pragma
dbapi_connection.execute('PRAGMA journal_mode=WAL')
sqlite3.OperationalError: cannot change into wal mode from within a transaction
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:/Users/Namaz/PycharmProjects/RAT/CHAT-BOT.py", line 5, in <module>
chatbot = ChatBot('Charlie')
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\chatterbot\chatterbot.py", line 28, in __init__
self.storage = utils.initialize_class(storage_adapter, **kwargs)
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\chatterbot\utils.py", line 33, in initialize_class
return Class(*args, **kwargs)
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\chatterbot\storage\sql_storage.py", line 46, in __init__
if not self.engine.dialect.has_table(self.engine, 'Statement'):
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\dialects\sqlite\base.py", line 1666, in has_table
connection, "table_info", table_name, schema=schema
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\dialects\sqlite\base.py", line 2180, in _get_table_pragma
cursor = connection.execute(statement)
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\engine\base.py", line 2234, in execute
connection = self._contextual_connect(close_with_result=True)
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\engine\base.py", line 2302, in _contextual_connect
self._wrap_pool_connect(self.pool.connect, None),
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\engine\base.py", line 2340, in _wrap_pool_connect
e, dialect, self
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\engine\base.py", line 1584, in _handle_dbapi_exception_noconnection
sqlalchemy_exception, with_traceback=exc_info[2], from_=e
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\util\compat.py", line 182, in raise_
raise exception
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\engine\base.py", line 2336, in _wrap_pool_connect
return fn()
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\pool\base.py", line 364, in connect
return _ConnectionFairy._checkout(self)
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\pool\base.py", line 778, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\pool\base.py", line 495, in checkout
rec = pool._do_get()
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\pool\impl.py", line 241, in _do_get
return self._create_connection()
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\pool\base.py", line 309, in _create_connection
return _ConnectionRecord(self)
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\pool\base.py", line 440, in __init__
self.__connect(first_connect_check=True)
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\pool\base.py", line 668, in __connect
pool.dispatch.connect(self.connection, self)
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\sqlalchemy\event\attr.py", line 261, in __call__
fn(*args, **kw)
File "C:\Users\Namaz\AppData\Local\Programs\Python\Python36\lib\site-packages\chatterbot\storage\sql_storage.py", line 43, in set_sqlite_pragma
dbapi_connection.execute('PRAGMA journal_mode=WAL')
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) cannot change into wal mode from within a transaction
(Background on this error at: http://sqlalche.me/e/13/e3q8)
Process finished with exit code 1
Downgrading to 0.7.4 as said above should not be a option it should be fixed here, or is it a problem with python 3.6 ? Does changing the Python Version affect this?
Changing the Adapter to MongoDB does not change the situation here as well :(
Downgrading to .7.4 worked for me, however, I ran into bug #1426 that is now closed, but I found a syntax workaround mentioned there. It appears others are running into other issues going down to .7.4, and I just hope I somehow avoid that. Would hate to get squeezed out by bugs occurring in various releases. Bump for this one being a high priority. Either way, I am still excited to work with this, and aside from the bugs I had to navigate, the simplicity of use for such complex tasks is quite amazing.
Did anyone find a fix to this? I am having the same problem. Python 3.8 and Chatterbot==1.0.2
. Downgrading to 0.7.4
is not a good solution for me as a lot of dependencies are no longer supported, and it causes other parts of my program to fail out.
Did anyone find a fix to this? I am having the same problem. Python 3.8 and
Chatterbot==1.0.2
. Downgrading to0.7.4
is not a good solution for me as a lot of dependencies are no longer supported, and it causes other parts of my program to fail out.
So I had been having various issues including this one with my setup. I was @ .7.4 for a while, but decided to make another attempt to get things working at the latest release. I did a reinstall of chatterbot and ALL dependencies as an admin in command terminal (windows), and all issues got resolved.