A DB-API2 compliant module in Python for interacting with a SQLite relational database.
Questions tagged [pysqlite]
140 questions
4
votes
11 answers
How to install pysqlite?
I am trying to install pysqlite (Python interface to the SQLite). I downloaded the file with the package (pysqlite-2.5.5.tar.gz). And I did the following:
gunzip pysqlite-2.5.5.tar.gz
tar xvf pysqlite-2.5.5.tar
\cd pysqlite-2.5.5
python setup.py…

Verrtex
- 4,317
- 9
- 34
- 33
4
votes
0 answers
GeoDjango and Spatialite on Mac: issue with C extension Loading
I'm following the GeoDjango Tutorial to set up a dev spatial DB for my project on my home machine, a Mac Mini running OSX 10.8.2. I installed the KyngChaos packages (UnixImageIO, PROJ, GEOS, SQLite3 and GDAL) and spatialite as detailed in the OSX…

ergelo
- 923
- 2
- 9
- 15
4
votes
2 answers
Issue with SQLite DROP TABLE statement
EDIT: At this point, I found the errant typo that was responsible, and my question has become "How did the typo that I made cause the error that I received" and "How might I have better debugged this in the future?"
I've setup a database script for…

Retsam
- 30,909
- 11
- 68
- 90
4
votes
2 answers
SQLite - calculate moving average
i have an table in sqlite using pysqlite:
create table t
(
id integer primary key not null,
time datetime not null,
price decimal(5,2)
)
how can i from this data calculate moving average with window X seconds large with an sql…

microo8
- 3,568
- 5
- 37
- 67
3
votes
1 answer
Problem Creating One File exe with pyinstaller and pysqlcipher
I'm trying to create a one file .exe to run on any windows machine but I've hit a problem with pysqlcipher. I've gone back to some basic code that just creates a simple database with a key, on my dev machine all works fine whether I use the python…

Andrew Smith
- 117
- 9
3
votes
2 answers
Why do inserts slow down so much as DB grows?
I'm doing a personal project that generates a lot of data, and I thought that storing it in a local DB made sense. However, I'm seeing insane slowdown as the DB grows, which makes it infeasible to run.
I made a simple test showing what I'm doing. I…

user1902853
- 399
- 1
- 12
3
votes
0 answers
Python 3.7.2 ModuleNotFoundError: No module named pysqlite2
I'm working on windows with python 3.7.2 and using uszipcode library and import SearchEngine for getting a list of zip codes which start with the argument of the function.
I'm getting the following errors:
Traceback (most recent call last):
…

user3881365
- 31
- 2
3
votes
3 answers
Python: Unable to easy_install (Windows 7 x64)
I'm running python 2.7 on Windows 7 x64, and trying to easy_install pysqlite.
With command: easy_install -U pysqlite
It exits with the error:
error: Setup script exited with error: Unable to find vcvarsall.bat
This site:…

Dirk
- 3,073
- 4
- 31
- 36
3
votes
1 answer
Which is better - execute(INSERT) or executemany(INSERT)
Situation: Need to insert quite a bit of data into a SQLite database.
Problem: There are two statements we can use to insert data -
data = [("111", "222", "333"), ("AAA", "BBB", "CCC"), ("XXX", "YYY", "ZZZ")]
#method1
for item in data:
…

Timothy Wong
- 689
- 3
- 9
- 28
3
votes
2 answers
Reproduce pysqlite's row_factory on apsw
I have been trying to migrate away from pysqlite to apsw but I can't
find a way to reproduce its row_factory function.
this is my original code:
connection = sqlite3.connect("db.db3")
connection.row_factory = sqlite3.Row
cursor =…

relima
- 3,462
- 5
- 34
- 53
3
votes
3 answers
How expensive sqlite3.connect and close in SQLite?
I use connect() and cursor() for using SQLite
self.connector = sqlite3.connect(self.dbFile)
self.cursor = self.connector.cursor()
And close() for stop using it.
self.cursor.close()
How expensive (in terms of processing time) are they? Is it so…

prosseek
- 182,215
- 215
- 566
- 871
3
votes
4 answers
SQLite use autoindex instead my own index
I've problem with SQLite autoindex in UNIQUE table. I've create table like below.
c.execute('''CREATE TABLE user(
id INTEGER PRIMARY KEY,
email TEXT NOT NULL UNIQUE,
password TEXT NOT NULL,
name TEXT NOT NULL,
…

Christoforus Surjoputro
- 558
- 6
- 17
3
votes
2 answers
How to resolve No module named _sqlite3 when I create Django application?
I have installed python version 3.4 on CentOS 2.6
and I also installed Django 1.8.
Then I try to create Django application like below.
$django-admin.py startproject mysite
$cd mysite
$python3 manage.py startapp poll
I got some error. How can I…

eachone
- 557
- 3
- 11
- 28
3
votes
1 answer
Override DEFINEs in setup.cfg in source eggs
The source egg of PySQLite 2.6.0 contains a file setup.cfg that looks like this:
[build_ext]
#define=
#include_dirs=/usr/local/include
#library_dirs=/usr/local/lib
libraries=sqlite3
define=SQLITE_OMIT_LOAD_EXTENSION
I'd like to build the egg with…

Attila O.
- 15,659
- 11
- 54
- 84
3
votes
1 answer
Python sqlite copy table from one database to another
I'm using python 2.7 with the builtin sqlite3 module on Windows XP. The code looks like the following:
#!/usr/bin/env python2
import sqlite3
import sys
def open_db(nam):
conn = sqlite3.connect(sys.argv[1])
# Let rows returned be of…

Ayman
- 11,265
- 16
- 66
- 92