As explained here : https://gis.stackexchange.com/a/277071/20802 the standard Python framework on Mac OS X is not compile with the load extension function. Therefore it is impossible to use sql queries with this package and within QGIS (2.18 or 3.0) on Mac OSx.
The kyngchaos version of QGIS is compile to work with the standard version of Python (http://www.kyngchaos.com/software/qgis) but as this problem arise could someone tell me how to point out the pip version of Python to QGIS rather than the standard one? Or any other solution
https://gis.stackexchange.com/users/55203/steven-kay gave a link to an older topic which might was working with older python version. but wasn't successful with Python 3.6