Formula 1
Formula 1

Reputation: 183

I'm getting a error in Google App Engine to do with import sqlite3? Can somebody help me please?

The error I getting is:

raise ImportError('No module named %s' % fullname)

ImportError: No module named _sqlite3

from _sqlite3 import *

from dbapi2 import *

import sqlite3

It has something to do with:

import sqlite3

Can anyone help me please? I'm using Google App Engine for Python on a Windows 7 machine just in case that has something to do with it.

The help would be much appreciate.

Thanks

Upvotes: 0

Views: 713

Answers (3)

Denisigo
Denisigo

Reputation: 640

Not really sure about your case, but it helped me a couple of times. You should add _sqlite3 to _WHITE_LIST_C_MODULES to python sandbox module here:

[path_to_google_app_engine]/google/appengine/tools/devappserver2/sandbox.py

somehow like this:

_WHITE_LIST_C_MODULES = [
    'array',
    '_ast',
    ...
    '_sqlite3'
]

Upvotes: 1

Dave W. Smith
Dave W. Smith

Reputation: 24956

You can't directly use sqlite3 from our dev_appserver unless you're willing to modify our source. The reason is that dev_appserver is supposed to give you a development-time experience that simulates what's available (and not avilable) when you upload code to appsot.com. sqlite3 won't be available then.

Upvotes: 0

Simon Callan
Simon Callan

Reputation: 3130

As far as I am aware, Google App Engine does not support sqlite. It has its own database system, that uses a vaguely SQL like language call GQL.

To prevent you accidently using the wrong database, the developement environment has intercepted your import of sqlite, and has raised an error.

Upvotes: 0

Related Questions