一千萬個為什麽

搜索

ImportError:沒有名為_sqlite3的模塊

我正在為Google App Engine寫作,我的本地測試收到以下錯誤:

-->  --> -->

Traceback (most recent call last):
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 3185, in _HandleRequest
    self._Dispatch(dispatcher, self.rfile, outfile, env_dict)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 3128, in _Dispatch
    base_env_dict=env_dict)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 515, in Dispatch
    base_env_dict=base_env_dict)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2387, in Dispatch
    self._module_dict)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2297, in ExecuteCGI
    reset_modules = exec_script(handler_path, cgi_path, hook)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2193, in ExecuteOrImportScript
    exec module_code in script_module.__dict__
  File "C:\Users\Chris Reade\Documents\SI 182\Final\geneticsalesman\Final.py", line 7, in 
    from pyevolve import DBAdapters
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1272, in Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1922, in load_module
    return self.FindAndLoadModule(submodule, fullname, search_path)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1272, in Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1824, in FindAndLoadModule
    description)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1272, in Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1775, in LoadModuleRestricted
    description)
  File "C:\Users\Chris Reade\Documents\SI 182\Final\geneticsalesman\pyevolve\DBAdapters.py", line 21, in 
    import sqlite3
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1272, in Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1922, in load_module
    return self.FindAndLoadModule(submodule, fullname, search_path)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1272, in Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1824, in FindAndLoadModule
    description)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1272, in Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1775, in LoadModuleRestricted
    description)
  File "C:\Python26\lib\sqlite3\__init__.py", line 24, in 
    from dbapi2 import *
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1272, in Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1922, in load_module
    return self.FindAndLoadModule(submodule, fullname, search_path)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1272, in Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1824, in FindAndLoadModule
    description)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1272, in Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1775, in LoadModuleRestricted
    description)
  File "C:\Python26\lib\sqlite3\dbapi2.py", line 27, in 
    from _sqlite3 import *
ImportError: No module named _sqlite3

我的python方向有一個sqlite3的lib文件,但我不知道它為什麽找不到它。任何幫助將不勝感激。

最佳答案

App Engine SDK會努力為您在真實 App Engine(在Google服務器上)上失敗的任何模塊導入提供錯誤。後者不支持SQlite,因此給出錯誤只是SDK說“你將無法在真正的Google App Engine服務器上部署此代碼”的好方法!

轉載註明原文: ImportError:沒有名為_sqlite3的模塊