`I have made Django blog. I encountered this error after deploy using Elastic Beanstalk when trying to visit my website on AWS:
Django - deterministic=True requires SQLite 3.8.3 or higher upon running python manage.py runserver
So I found this solution:
Django – deterministic=True requires SQLite 3.8.3 or higher upon running python manage.py runserver
So i understand it like this:
-
In ubuntu terminal i type :
sudo apt install python3.10-venv
to install envirement -
Then in my Django project in Visual Studio i type
python3 -m venv django_my_site
to create virtual env -
Now i click "+" to open this env and type
pip3 install pysqlite3'
and'pip3 install pysqlite3-binary
-
After that i type
python3 -m pip freeze > requirements.txt
and i get requirements.txt file which looks like that:
asgiref==3.6.0
Django==4.1.4
Pillow==9.3.0
pysqlite3==0.5.0
pysqlite3-binary==0.5.0
sqlparse==0.4.3
Now AWS have problem with installing pysqlite3.
How to properly install pysqlite3 on AWS?
AWS log:
Encountered error while trying to install package.
pysqlite3`
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
src/blob.h:4:10: fatal error: sqlite3.h: No such file or directory
#include "sqlite3.h"
^~~~~~~~~~~
compilation terminated.
LINK TO MY REPOSITORY:
2
Answers
As mike said:
I add to requirements.tht just:
I also added in settings.py:
before:
The error here appears to stem from the lack of the development headers for
sqlite
compilation in the AWS environment.In your ubuntu environment, the development headers likely already exist, and you can confirm that they do with something like:
Since the author of
pysqlite3
has provided both the source distribution and a precompiled binary version, you should only add one to the requirements file you intend to ship to Elastic Beanstalk –pysqlite-binary
(https://pypi.org/project/pysqlite-binary/)Then you should be able to use it via
import pysqlite3