Questions tagged [sqlite3-python]
83 questions
2
votes
0 answers
Django project ModuleNotFoundError: No module named '_sqlite3'
OS bsd 13.2 on dedicated rental server
csh terminal
python3.9.17 system and venv
Django 4.2.2
wanting to learn django, I set up a venv and installed django there.
all good but at (django) pyweb@os3-286-32838:~/django/eigoweb % python3 manage.py…

lost in japan
- 21
- 2
1
vote
0 answers
How can I fix my database to get my foreign keys to work in SQLite3 Python?
I am attempting to make a database in Python using SQLite3, working around foreign keys doesn't seem to be going to well, I keep getting error messages and i am fully aware my poor formatting is somewhat of a contributor.
This is all of the…

Jojo
- 39
- 6
1
vote
1 answer
How to increment a whole column's values by x amount in SQLAlchemy?
I am looking to increase an entire column's values by a certain variable amount, and initially I used sqlite3, but in order to optimise my script I had to switch to SQLAlchemy, but I am unable to find similar utilities in SQLAlchemy. For example,…

Justin Chee
- 427
- 1
- 3
- 14
1
vote
4 answers
PostgreSQL How find completely identical orders on set of items and their quantity?
I have a table with orders (for each order (transaction_id) there are client_id and item_id and quantity)
I need to find completely identical orders for a set of goods and their quantity in the order
CREATE TABLE IF NOT EXISTS orders (client_id…

Virus Scan
- 13
- 3
1
vote
0 answers
Displaying map from MBTiles file using Leaflet and Flask results in only in map controls being displayed in web page
I'm trying to display a map from an MBTiles file using Leaflet, Flask and Sqlite3. I have an MBTiles file of the New Zealand map, and I want to display a location with latitude and longitude values on a web page. I am able to serve the tiles using a…

Kishor
- 11
- 2
1
vote
1 answer
Python: CSV Directory to Sqlite3 Database
I am trying to convert a folder of CSV files into a Sqlite3 Database with python. Initially I was able to convert the data inside a single csv file I had made local to the folder with database and python script files. I have now made a copy of the…

Jonathan Susman
- 11
- 1
1
vote
0 answers
About to exceed table size limit in sqlite3
I have a utility that loads a sqlite3 table from a CSV file. The CSV file has 2000+ columns. SQLite3 tables have a limit of 2000 columns. The process that I have used so far has been to load the CSV into a dataframe, drop unrequired columns and load…

Simon Gibbard
- 11
- 1
1
vote
2 answers
Python3 find position/index of a name/element in a list with more than one of the same name
I am having a problem that I just don't know how to solve and nothing I'm finding is helping. My problem is that I have a list of names (strings), in this list I will have the same name show up more than once.
lst = ['hello.com', 'hello.com',…

Ori
- 31
- 8
0
votes
0 answers
Heroku deploying sqlite3 database path error
When I deploy my app with sqlite3 database, Heroku gives me this error:
Error traceback
I am sure that problem is not with path. Code works correct on my computer every time when I create or open database.
Path for database
All works correct only if…

sndmndss
- 9
- 5
0
votes
2 answers
I get some error when create new model in Django
I created 2 model for one to one in Django model
So model codes is very simple
enter image description here
I executed CMD after put the above code
python manage.py migrate
But I get this error message
enter image description here`

Royal WebGuru
- 1
- 2
0
votes
0 answers
ModuleNotFoundError: No module named '_sqlite3' when i wanted to create django app
I had a new mechine (PC), I want to use pipenv to work on my django app. It keeps on returning an error "ModuleNotFoundError: No module named '_sqlite3'" each time I try "python manage.py startapp " its really giving me issues and I dont know why.
I…
0
votes
1 answer
How to set a maximum integer value for a column in SQL?
I am creating a Python program for learning new words with the flash cards method. For this, I need an SQL database where a table is a pair of languages. When the user answers correctly, the value of the words pair increases by 1, but it should not…

Vlad F
- 3
- 1
0
votes
2 answers
How to toggle sometimes one and sometimes more than one item in Sqlite3?
def toggle_status_of_item(self, item_id: str):
sql = """UPDATE table
SET status = CASE status
WHEN 0 THEN 1
ELSE 0 END
WHERE item_id = ?"""
self.cur.execute(sql,…

Sun Bear
- 7,594
- 11
- 56
- 102
0
votes
1 answer
Correct syntax for python-sqlite3 script? How to select all rows that has a column with a specific value?
I wrote the following python-sqlite3 code. It has two issues:
I want to understand how to write a SQLite3 statement to extract all rows with "cola". What is the correct syntax for the .get_fav_drink_folks(drink) method?
Error:
line 25, in…

Sun Bear
- 7,594
- 11
- 56
- 102
0
votes
1 answer
Jinja2 UndefinedError - HTML Function call not working
I am working on a Grocery-Store web application using Flask and SQLAlchemy
I am trying to print the products as a card arranged under their respective categories
But then I get this error. I can't seem to figure out what the error is. All the…

Ananyaa S
- 1
- 1