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

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
kkumar326
Posts: 16
Joined: Wed Nov 15, 2017 5:30 am

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

Post by kkumar326 » Wed Feb 07, 2018 10:08 am

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.

Iyassou
Posts: 42
Joined: Sun Jun 26, 2016 9:15 am

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

Post by Iyassou » Wed Feb 14, 2018 6:12 am

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?

kkumar326
Posts: 16
Joined: Wed Nov 15, 2017 5:30 am

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

Post by kkumar326 » Wed Feb 14, 2018 10:18 am

There is no module as ffi. I'm using csv instead of sqlite now.

Post Reply