Help us understand the problem. What is going on with this article?

Django2.2で開発サーバー起動時にSQLite3のエラーが出た場合の対応

Amazon Linux release 2 (Karoo)

# Python3のインストール
sudo yum install python3
cd
python3 -m venv ~/myvenv/

# 仮想環境に切り替え
source ~/myvenv/bin/activate
# Djangoインストール
pip install Django

# Djangoのチュートリアルをやろうとしてプロジェクト作成
$ django-admin startproject mysite

# 開発用サーバー起動
$ python manage.py runserver

# 大量に出るので一部だけ
# SQLite3は3.8.3、または、3.8.3以降のバージョンにしてくださいエラー
packages/django/db/backends/sqlite3/base.py", line 63, in check_sqlite_version
    raise ImproperlyConfigured('SQLite 3.8.3 or later is required (found %s).' % Database.sqlite_version)
django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is required (found 3.7.17).

# SQLite3を最新化する
# ソースを取得 (ホームディレクトリで実行してます)
$ cd

# バージョンは「https://www.sqlite.org/download.html」で確認して、
# 新しいバージョンのファイル名を指定してください (2019/12/06追記)
# 例) SQLite 3.31.1の場合

$ wget https://www.sqlite.org/2020/sqlite-autoconf-3310100.tar.gz
$ tar xvfz sqlite-autoconf-3310100.tar.gz

# ビルドしてインストール
$ cd sqlite-autoconf-3310100
$ ./configure --prefix=/usr/local
$ make
$ sudo make install
$ sudo find /usr/ -name sqlite3

# コマンド結果
# /usr/lib64/python2.7/sqlite3と/usr/lib64/python3.7/sqlite3はディレクトリ
/usr/bin/sqlite3
/usr/lib64/python2.7/sqlite3
/usr/lib64/python3.7/sqlite3
/usr/local/bin/sqlite3

# 不要なファイル、ディレクトリ削除
$ cd 
$ rm sqlite-autoconf-3310100.tar.gz
$ rm -rf ./sqlite-autoconf-3310100

# バージョン確認
$ /usr/local/bin/sqlite3 --version

3.31.1 2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837bb4d6

$ /usr/bin/sqlite3 --version

3.7.17 2013-05-20 00:56:22 118a3b35693b134d56ebd780123b7fd6f1497668

$ sqlite3 --version

3.31.1 2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837bb4d6

$ sudo mv /usr/bin/sqlite3 /usr/bin/sqlite3_old
$ sudo ln -s /usr/local/bin/sqlite3 /usr/bin/sqlite3

# 共有ライブラリへパスを通す
# vi ~/.bashrcで設定を追加(すぐに反映する場合 source ~/.bashrc)しないとターミナルを起動するたびに実行することになります
$ export LD_LIBRARY_PATH="/usr/local/lib"

# PythonのSQLite3バージョン確認
$ python
Python 3.7.4 (default, Dec 13 2019, 01:02:18) 
[GCC 7.3.1 20180712 (Red Hat 7.3.1-6)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> sqlite3.sqlite_version
'3.31.1'
>>> exit()

# 開発用サーバー起動
$ cd
$ cd mysite
$ python manage.py runserver

参考URL
Using SQLite3 with Django 2.2 and Python 3.6.7 on Centos7
Upgrade Python's sqlite3 on Debian
How do I upgrade the SQLite version used by Python's SQLite3 module on Mac?

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした