| 179 | ==== `NameError: global name 'sqlite' is not defined` ==== |
| 180 | |
| 181 | This error usually comes from an invalid PySqlite installation:[[BR]] |
| 182 | The Python interpreter is not able to import the sqlite module. |
| 183 | {{{ |
| 184 | ... |
| 185 | File ".../python2.3/site-packages/trac/db.py", line 321, in init_db |
| 186 | cnx = sqlite.connect(path, timeout=int(params.get('timeout', 10000))) |
| 187 | NameError: global name 'sqlite' is not defined |
| 188 | ... |
| 189 | }}} |
| 190 | |
| 191 | * Check that the sqlite Python module can be load from a Python interpreter |
| 192 | {{{ |
| 193 | python |
| 194 | >>> import sqlite |
| 195 | }}} |
| 196 | * Check that the Python intepreter that is run from the web server can find this module.[[BR]] |
| 197 | The default path for this module is `<python_lib_dir>/site-packages`. If you've installed the module in another directory, make sure the `sys.path` variable is set up with this directory (more on this in TracCgi, TracModPython, TracFastCgi). |
| 198 | |
| 199 | A common mistake is to install PySqlite for one Python interpreter, and run the server with another Python interpreter: both interpreters do not use the same paths to search for modules. |
| 200 | |