本文介紹了錯誤配置的問題(需要SQLite 3.8.3或更高版本)(&A)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我已經看過一些關于SQLite 3.8.3或更高版本是必需的問題的文章,通常是關于舊的sqlite3版本,可以通過LD_LIBRARY_PATH=new/installed/sqlite3
安裝最新版本來解決。
嗯,它確實在一定程度上解決了我的問題。當我完成上述過程時,我確實成功地運行了python3 manage.py runserver
。但是,當我打算將項目移到uwsgi時,我得到了django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is required (found 3.7.17).
關注我的uWSGI外殼命令:
uwsgi --http :8000 --pythonpath /mnt/datasource/<privacy_hidden>/venv/bin/python3 --virtualenv=/mnt/datasource/app-repos-management/back/venv --wsgi-file delivery/wsgi.py --master --processes 4 --threads 4
相對輸出為:
*** Starting uWSGI 2.0.18 (64bit) on [Mon Mar 2 16:55:39 2020] ***
compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-39) on 02 March 2020 08:43:11
os: Linux-3.10.0-1062.4.3.el7.x86_64 #1 SMP Wed Nov 13 23:58:53 UTC 2019
nodename: localhost.localdomain
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 4
current working directory: /mnt/datasource/<privacy_hidden>
detected binary path: /home/user/.local/bin/uwsgi
your processes number limit is 31049
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uWSGI http bound on :8000 fd 4
uwsgi socket 0 bound to TCP address 127.0.0.1:45914 (port auto-assigned) fd 3
Python version: 3.6.8 (default, Aug 7 2019, 17:28:10) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
PEP 405 virtualenv detected: /mnt/datasource/<privacy_hidden>/venv
Set PythonHome to /mnt/datasource/<privacy_hidden>/venv
Python main interpreter initialized at 0x19e8e70
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 521440 bytes (509 KB) for 16 cores
*** Operational MODE: preforking+threaded ***
added /mnt/datasource/<privacy_hidden>/venv/bin/python3 to pythonpath.
Traceback (most recent call last):
File "delivery/wsgi.py", line 16, in <module>
application = get_wsgi_application()
File "/mnt/datasource/<privacy_hidden>/venv/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
django.setup(set_prefix=False)
File "/mnt/datasource/<privacy_hidden>/venv/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/mnt/datasource/<privacy_hidden>/venv/lib/python3.6/site-packages/django/apps/registry.py", line 114, in populate
app_config.import_models()
File "/mnt/datasource/<privacy_hidden>/venv/lib/python3.6/site-packages/django/apps/config.py", line 211, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib64/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/mnt/datasource/<privacy_hidden>/venv/lib/python3.6/site-packages/django/contrib/auth/models.py", line 2, in <module>
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
File "/mnt/datasource/<privacy_hidden>/venv/lib/python3.6/site-packages/django/contrib/auth/base_user.py", line 47, in <module>
class AbstractBaseUser(models.Model):
File "/mnt/datasource/<privacy_hidden>/venv/lib/python3.6/site-packages/django/db/models/base.py", line 121, in __new__
new_class.add_to_class('_meta', Options(meta, app_label))
File "/mnt/datasource/<privacy_hidden>/venv/lib/python3.6/site-packages/django/db/models/base.py", line 325, in add_to_class
value.contribute_to_class(cls, name)
File "/mnt/datasource/<privacy_hidden>/venv/lib/python3.6/site-packages/django/db/models/options.py", line 208, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
File "/mnt/datasource/<privacy_hidden>/venv/lib/python3.6/site-packages/django/db/__init__.py", line 28, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/mnt/datasource/<privacy_hidden>/venv/lib/python3.6/site-packages/django/db/utils.py", line 207, in __getitem__
backend = load_backend(db['ENGINE'])
File "/mnt/datasource/<privacy_hidden>/venv/lib/python3.6/site-packages/django/db/utils.py", line 111, in load_backend
return import_module('%s.base' % backend_name)
File "/usr/lib64/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/mnt/datasource/<privacy_hidden>/venv/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py", line 68, in <module>
check_sqlite_version()
File "/mnt/datasource/<privacy_hidden>/venv/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py", line 65, 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).
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 81912)
spawned uWSGI worker 1 (pid: 81914, cores: 4)
spawned uWSGI worker 2 (pid: 81915, cores: 4)
spawned uWSGI worker 3 (pid: 81919, cores: 4)
spawned uWSGI worker 4 (pid: 81923, cores: 4)
spawned uWSGI http 1 (pid: 81927)
順便說一句,我的sqlite3.sql_version
測試是'3.31.1'
,任何建議都會很酷