Forums

sqlite3 db lock problem and PyPDF2 issue

Quick update: database lock issue resolved. But the PyPDF2 library issue remains.

Hi,

I just deployed a flask web app using a sqlite3 database. But I'm encountering database lock problem, which was never an issue when I run it locally. Also, I'm the only one person testing the deployment, thus, it's unlikely that it was caused by too many concurrent users (may db requests at the same time).

Environment: Python version: 3.9.13

error code: Error initializing xyz table: database is lockedĀ 

And PyPDF2 issue error code: Error processing PDF: module 'PyPDF2' has no attribute 'PdfReader' Again, PyPDF2 library worked perfectly fine when the web app was running locally.

Please advise a solution. Thanks.

On my windows 11 computer, here's the detail info of my PyPDF2 that works. pip show PyPDF2 Name: PyPDF2 Version: 3.0.1

And since my new web app for a client is stored on Ubuntu 20 (with pythonanywhere.com), how can we find its equivalent so that I can install it for his instance?

I've upgraded the default version on my PA instance to the following now but still to no avail. Name: PyPDF2 Version: 3.0.1

That does seem like a PyPDF2 version issue. Are you sure you upgraded the version in the correct virtualenv?

I finally solved the problem in the wee hours of this morning (around 1am). But just curious, are you saying if PyPDF2 has been upgraded to a virtualenv then the instance's python3.10 would recognize PyPDF2 in the virtualenv and use it instead of the default old version of 1.27.12?

It depends whether the virtualenv is activated where your code is running.