Questions tagged [pysqlite]

A DB-API2 compliant module in Python for interacting with a SQLite relational database.

140 questions
2
votes
1 answer

The open/close function of SQLite implementation

I'm trying to come up with SQLiteDB object, and following is the open/close code for it. Does this work without problem? Am I missing something important? For close(), I use con.close() and cursor.close(), but I'm wondering if cursor.close() is…
prosseek
  • 182,215
  • 215
  • 566
  • 871
2
votes
0 answers

I used sqlite + pysqlite2 + sqlalchemy. But there are some confused error. eg.undefined symbol

File "/home/myweb/app/db.py", line 40, in __init__ engine = create_engine('sqlite:///'+db_path) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/__init__.py", line 386, in create_engine return strategy.create(*args,…
thinkdeeper
  • 351
  • 1
  • 3
  • 9
2
votes
1 answer

Fetch the last row of a cursor with SQLite

On Android, I am very used to using cursor.moveToLast() to fetch the last item in a cursor. I can't seem to find an equivalent for Python's SQLite, however. Is there a function which will allow me to get the last row of a cursor? I could just call…
cheese1756
  • 1,719
  • 3
  • 17
  • 25
2
votes
2 answers

Why my python does not see pysqlite?

I would like to have an interface between Python and sqlite. Both are installed on the machine. I had an old version of Python (2.4.3). So, pysqlite was not included by default. First, I tried to solve this problem by installing pysqlite but I did…
Verrtex
  • 4,317
  • 9
  • 34
  • 33
2
votes
1 answer

Inserting JSON data to sqlite - OperationalError: unrecognized token "{"

I'm doing something like this in my code: import sqlite3 ... sqlString=company['name']+","+simplejson.dumps(info) cur.execute("INSERT INTO companyInfo VALUES("+sqlString+")") but I'm getting the following error: cur.execute("INSERT INTO…
leonsas
  • 4,718
  • 6
  • 43
  • 70
2
votes
1 answer

Python: SQLAlchemy ImportError: No module named pysqlite2

I'm running python 2.7.3 which I manually installed in my home directory as I don't have root access. 2.6.6 is installed on the system, but I really need 2.7. When I run the app, SQLAlchemy throws this ImportError. So I know that pysqlite2 is now…
Ben Davis
  • 617
  • 2
  • 11
  • 19
2
votes
0 answers

Sqlite 2 python using a python tempfile

I'm experiencing some strange behavior from sqlite using a database stored as a python tempfile. Essentially, querying the sqlite_master table works fine, but querying another table returns: DatabaseError: database disk image is malformed The…
PeterT
  • 51
  • 4
1
vote
2 answers

Digi ConnectPort Database adapter

I have a Digi ConnectPort X4 here and I am going to run a simple web server on it to serve the information from the ZigBee network that is attached. The HTTPBaseServer and subclasses are pure Python classes, but I also want to have some kind of…
Joost
  • 536
  • 4
  • 16
1
vote
0 answers

could not convert BLOB to Buffer - Sqlite3

I am trying to store an html as a blob in a sqlite3 DB. However, I get the following error "could not convert BLOB to Buffer". I could store the html as a TEXT but I am running into unicode errors. So my current approach is like this. def…
ssarangi
  • 602
  • 1
  • 10
  • 28
1
vote
1 answer

Creating an empty database in SQLite from a template SQLite file

I have a question about a problem that I'm sure is pretty often, but I still couldn't find any satisfying answers. Suppose I have a huge-size original SQLite database. Now, I want to create an empty database that is initialized with all the tables,…
Swistack
  • 195
  • 7
1
vote
1 answer

WARNING: Legacy build of wheel for 'pysqlite3' created no files. - How do I build a non-legacy build of wheels?

I try to install a package (https://github.com/lucidrains/stylegan2-pytorch) on my AWS EC2 instance. I have installed Python 3.7 and is trying to install the package through that by running: python3.7 -m pip install stylegan2_pytorch It…
Brainmaniac
  • 2,203
  • 4
  • 29
  • 53
1
vote
0 answers

how to set properly the TYPEs for columns while importing excel data into sqlite database with python3?

I am importing excel data into sqlite database with python3 with the below code: import sqlite3 import pandas as pd con = sqlite3.connect("test.db") wb = pd.read_excel("for_DB_data.xlsx", sheet_name=None) for sheet in wb: …
1
vote
0 answers

Error while connecting to sqlite. Incorrect number of bindings supplied. The current statement uses 0, and there are 1 supplied

I am trying to make a connection to my (pysqlcipher) encrypted sqlite database but I am failing because PRAGMA key input is incorrect. I have my correct password 'test' in a separate .env file. Even though everything should be correct I get the…
JeffA
  • 11
  • 1
1
vote
1 answer

Error while loading data from csv to table using pandas dataframe

I am having the csv file, when I am trying to load CSV to the table using pandas dataframe I am getting an error please help me import pyodbc import pandas as pd df = pd.read_csv("C:\PYTHON\csv.csv") conn = pyodbc.connect('Driver=ODBC Driver 17 for…
Chanukya
  • 5,833
  • 1
  • 22
  • 36
1
vote
1 answer

Not all parameters were used in the SQL statement python, MySQL

I'm trying to develop this SQL scoring system executed in python but I get the following error in Sublime, does anyone know how to resolve and adjust any potential future errors. I've looked at similar problems addressed on different stack…
Lamtheram
  • 89
  • 1
  • 7