I am attempting to deploy a Python Flask, HTML, JavaScript web application through Google App Engine.
I'm using sqlite3 for my database
>>> python
>>> import sqlite3
This works just fine. Deploying my web app with
$ gcloud app deploy
Works just fine.
However when I visit the page, I receive this message
Error: Server Error
The server encountered an error and could not complete your request. Please try again in 30 seconds.
And when I check the Error Reporting at https://console.cloud.google.com/home/dashboard I get this error
Traceback (most recent call last):
File "/base/alloc/tmpfs/dynamic_runtimes/python27g/941d77da994078b1/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 240, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/base/alloc/tmpfs/dynamic_runtimes/python27g/941d77da994078b1/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 311, in _LoadHandler
handler, path, err = LoadObject(self._handler)
File "/base/alloc/tmpfs/dynamic_runtimes/python27g/941d77da994078b1/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 85, in LoadObject
obj = __import__(path[0])
File "/base/data/home/apps/p~live-business-solutions/20191010t190446.421644656225294026/webapp.py", line 9, in <module>
from databasefunctions import *
File "/base/data/home/apps/p~live-business-solutions/20191010t190446.421644656225294026/databasefunctions.py", line 5, in <module>
import sqlite3
File "/base/alloc/tmpfs/dynamic_runtimes/python27g/941d77da994078b1/python27/python27_dist/lib/python2.7/sqlite3/__init__.py", line 24, in <module>
from dbapi2 import *
File "/base/alloc/tmpfs/dynamic_runtimes/python27g/941d77da994078b1/python27/python27_dist/lib/python2.7/sqlite3/dbapi2.py", line 28, in <module>
from _sqlite3 import *
ImportError: No module named _sqlite3
It is from the line
import sqlite3
of my databasefunctions.py file. I'm not sure why this is, could anyone please help?
I was wondering if I am supposed to somehow include sqlite3 in requirements.txt? and if so how I would do this?