in Education by
My goal is to host Django app on CentOs 7 with python3.10 I've manage to download and configure Python, sqlite to work with manage.py runserver but it dosn't work when i try to host it with apache. Apache throws error: ImportError: /usr/local/lib/python3.10/lib-dynload/_sqlite3.cpython-310-x86_64-linux-gnu.so: undefined symbol: sqlite3_trace_v2 Installed Versions System: CentOs 7 Python: 3.10.4 sqlite: 3.28.0 mod_wsgi: 4.9.0 Apache: 2.4.6 Apache .conf WSGIScriptAlias / /var/www/portal/portal/wsgi.py WSGIPythonPath /var/www/portal/:/var/www/venv/lib/python3.10/site-packages ServerName 192.168.1.25 Alias /static /var/www/portal/static/ DocumentRoot /var/www/portal AllowOverride All Require all granted Allow from all Require all granted Full Traceback: Traceback (most recent call last): File "/var/www/portal/portal/wsgi.py", line 22, in application = get_wsgi_application() File "/var/www/venv/lib/python3.10/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application django.setup(set_prefix=False) File "/var/www/venv/lib/python3.10/site-packages/django/__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/var/www/venv/lib/python3.10/site-packages/django/apps/registry.py", line 116, in populate app_config.import_models() File "/var/www/venv/lib/python3.10/site-packages/django/apps/config.py", line 304, in import_models self.models_module = import_module(models_module_name) File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/var/www/venv/lib/python3.10/site-packages/django/contrib/auth/models.py", line 3, in from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager File "/var/www/venv/lib/python3.10/site-packages/django/contrib/auth/base_user.py", line 49, in class AbstractBaseUser(models.Model): File "/var/www/venv/lib/python3.10/site-packages/django/db/models/base.py", line 141, in __new__ new_class.add_to_class("_meta", Options(meta, app_label)) File "/var/www/venv/lib/python3.10/site-packages/django/db/models/base.py", line 369, in add_to_class value.contribute_to_class(cls, name) File "/var/www/venv/lib/python3.10/site-packages/django/db/models/options.py", line 235, in contribute_to_class self.db_table, connection.ops.max_name_length() File "/var/www/venv/lib/python3.10/site-packages/django/utils/connection.py", line 15, in __getattr__ return getattr(self._connections[self._alias], item) File "/var/www/venv/lib/python3.10/site-packages/django/utils/connection.py", line 62, in __getitem__ conn = self.create_connection(alias) File "/var/www/venv/lib/python3.10/site-packages/django/db/utils.py", line 208, in create_connection backend = load_backend(db["ENGINE"]) File "/var/www/venv/lib/python3.10/site-packages/django/db/utils.py", line 113, in load_backend return import_module("%s.base" % backend_name) File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/var/www/venv/lib/python3.10/site-packages/django/db/backends/sqlite3/base.py", line 15, in from sqlite3 import dbapi2 as Database File "/usr/local/lib/python3.10/sqlite3/__init__.py", line 57, in from sqlite3.dbapi2 import * File "/usr/local/lib/python3.10/sqlite3/dbapi2.py", line 27, in from _sqlite3 import * ImportError: /usr/local/lib/python3.10/lib-dynload/_sqlite3.cpython-310-x86_64-linux-gnu.so: undefined symbol: sqlite3_trace_v2 JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
I didn't found any solution for this problem but I have downgraded python to 3.9.12 and it works now. Steps to reproduce to make it work with python 3.9.12 INSTALLATION REQUIRED PACKAGES: yum update yum groupinstall "Development Tools" -y yum install wget httpd httpd-devel openssl-devel libffi-devel bzip2-devel -y wget https://www.python.org/ftp/python/3.9.12/Python-3.9.12.tgz tar xvf Python-3.9.12.tgz wget https://www.sqlite.org/2019/sqlite-autoconf-3280000.tar.gz tar zxvf sqlite-autoconf-3280000.tar.gz SQLITE INSTALLATION: cd ~/sqlite-autoconf-3280000 ./configure make make install PYTHON INSTALLATION: cd ~/Python-3.9.12 ./configure --enable-loadable-sqlite-extensions --enable-shared --with-ssl SET UP LD_LIBRARY_PATH: vi ~/.bashrc export LD_LIBRARY_PATH=/usr/local/lib source ~/.bashrc CREATE VIRTUAL ENV: cd /opt python3.9 -m venv venv MOD_WSGI INSTALLATION FOR CURRENT VERSION OF PYTHONA: source ./venv/bin/activate pip install mod_wsgi mod_wsgi-express install-module > /etc/httpd/conf.modules.d/02-wsgi.conf UPDATE SQLITE (TODO: find better solution. Now sqlite verison works with installed django, after updating django you have to manually change it again, Right now can t find better solution): source /opt/venv/bin/activate pip install pysqlite3 pip install pysqlite3-binary vi /opt/venv/lib/python3.9/site-modules/django/db/backends/sqlite3/base.py change 'from sqlite3 import ...' to 'from pysqlite3 import ...'

Related questions

0 votes
    I'm trying to compile GTK+ 3 with ATK 2.2.0 on CentOS, but am getting an error with ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 7, 2022 in Education by JackTerrance
0 votes
    I'm trying to compile GTK+ 3 with ATK 2.2.0 on CentOS, but am getting an error with ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    I was coping with many problems to get stuck with this one. I have installed yum repository on server ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    I have installed Docker Desktop for windows Docker version 18.09.2, build 6247962, and I'm not able ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    I am unable to find the containers under the directory: /var/lib/docker/containers Can you please tell me the ... the host machine? Select the correct answer from above options...
asked Jan 24, 2022 in Education by JackTerrance
0 votes
    The _____________ command is used on Linux for getting the DNS and host-related information. (a) dnslookup (b) ... Security questions and answers pdf, mcq on Cyber Security pdf,...
asked Nov 4, 2021 in Education by JackTerrance
0 votes
    I have a web/ios react-native project. On web this works without any issue, but on iOS I am getting an error ... user progress: writing string of >>${JSON.stringify(user.progress)}...
asked Apr 16, 2022 in Education by JackTerrance
0 votes
    The logical port is associated with the type of protocol used along with the IP address of the host. (a) True ... Security questions and answers pdf, mcq on Cyber Security pdf,...
asked Nov 4, 2021 in Education by JackTerrance
0 votes
    In port scanning, a port is always associated with the _____________ (typically of host system) & the type ... for-Cyber Security:,Cyber Security-Jobs:,Cyber Security Applications...
asked Nov 1, 2021 in Education by JackTerrance
0 votes
    I have a strange problem. I'm executing insert using prepared statement like this: try (Connection ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I'm trying to implement continuous integration and continuous deployment to my DEV Azure App Service. I'm ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    I'm getting into user scripting with tampermonkey and can't get through this error, any help would be ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 16, 2022 in Education by JackTerrance
0 votes
    I am using module jsonwebtoken 8.4.0 in a nodejs 10.2.0 app. A JWT token is generated on https: ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 16, 2022 in Education by JackTerrance
...