错误配置的问题(需要SQLite 3.8.3或更高版本)(&A) [英] Django & uWSGI ImproperlyConfigured Problem(SQLite 3.8.3 or later is required)

查看:199
本文介绍了错误配置的问题(需要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',任何建议都会很酷🙏。

推荐答案

升级SQLite3后,用较新的SQLite3替换系统默认的SQLite3。

mv /usr/bin/sqlite3  /usr/bin/sqlite3_old
ln -s /usr/local/bin/sqlite3   /usr/bin/sqlite3
echo "/usr/local/lib" > /etc/ld.so.conf.d/sqlite3.conf
ldconfig

我的操作系统是CentOS7。

这篇关于错误配置的问题(需要SQLite 3.8.3或更高版本)(&A)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆