Page 1 of 1

Sqlite3 throwing: AttributeError: 'NoneType' object has no attribute 'func'

Posted: Wed Feb 07, 2018 10:08 am
by kkumar326
Hello,

I was checking sqlite3 module from here: https://github.com/micropython/micropyt ... er/sqlite3

I imported ffilib library from here: https://github.com/micropython/micropyt ... /ffilib.py

Now, when I'm running "import sqlite3", I'm getting this error:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "//sqlite3.py", line 7, in <module>
AttributeError: 'NoneType' object has no attribute 'func'

Please check.

Re: Sqlite3 throwing: AttributeError: 'NoneType' object has no attribute 'func'

Posted: Wed Feb 14, 2018 6:12 am
by Iyassou
Line 7 calls func on sq3, which is set to ffilib.open("libsqlite3"). The

Code: Select all

AttributeError: 'NoneType' object has no attribute 'func'
means that ffilib.open("libsqlite3") is returning None whereas it shouldn't be, as I understand it. In open's definition, the first way it can return None is if ffi isn't imported. Could you check if ffi gets imported?

Re: Sqlite3 throwing: AttributeError: 'NoneType' object has no attribute 'func'

Posted: Wed Feb 14, 2018 10:18 am
by kkumar326
There is no module as ffi. I'm using csv instead of sqlite now.