Andrew Fletcher published: 23 August 2022 1 minute read
Error when running ckan.ini init
from flask_debugtoolbar import DebugToolbarExtension
ModuleNotFoundError: No module named 'flask_debugtoolbar'
Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate
Then check your location is
cd /usr/lib/ckan/default/src
Install flask_debugtoolbar
Need to install flask_debugtoolbar, and do so by executing the command
pip install flask_debugtoolbar --upgrade
Response
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: flask_debugtoolbar in /home/_ub_admin/.local/lib/python3.8/site-packages (0.11.0)
Collecting flask_debugtoolbar
Downloading Flask_DebugToolbar-0.13.1-py3-none-any.whl (324 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 324.6/324.6 kB 13.4 MB/s eta 0:00:00
Requirement already satisfied: Flask>=0.8 in /home/_ub_admin/.local/lib/python3.8/site-packages (from flask_debugtoolbar) (1.1.1)
Requirement already satisfied: werkzeug in /home/_ub_admin/.local/lib/python3.8/site-packages (from flask_debugtoolbar) (1.0.0)
Requirement already satisfied: itsdangerous in /home/_ub_admin/.local/lib/python3.8/site-packages (from flask_debugtoolbar) (1.1.0)
Requirement already satisfied: Blinker in /usr/lib/python3/dist-packages (from flask_debugtoolbar) (1.4)
Requirement already satisfied: click>=5.1 in /home/_ub_admin/.local/lib/python3.8/site-packages (from Flask>=0.8->flask_debugtoolbar) (7.1.2)
Requirement already satisfied: Jinja2>=2.10.1 in /usr/lib/python3/dist-packages (from Flask>=0.8->flask_debugtoolbar) (2.10.1)
Installing collected packages: flask_debugtoolbar
Attempting uninstall: flask_debugtoolbar
Found existing installation: Flask-DebugToolbar 0.11.0
Uninstalling Flask-DebugToolbar-0.11.0:
Successfully uninstalled Flask-DebugToolbar-0.11.0
Successfully installed flask_debugtoolbar-0.13.1
Restart Nginx
sudo service nginx restart
Given your configuration file has the settings for your database, recreate the database tables:
cd /usr/lib/ckan/default/src/ckan
ckan -c /etc/ckan/default/ckan.ini db init
You should now be able to start CKAN in the development web server and have it start up without any problems:
ckan -c /etc/ckan/default/ckan.ini run
Related articles
Andrew Fletcher
•
28 Aug 2024
Troubleshooting PHP 8.3 mbstring issues on Ubuntu with Nginx
Maintaining a Drupal site is usually smooth sailing once the environment is properly set up. However, even in a stable environment, updates to modules can sometimes reveal underlying configuration issues that weren't apparent before. This was the case when I updated a contrib module on a Drupal 10.3...
Andrew Fletcher
•
26 Jun 2024
Upgrading Nginx on Ubuntu to due vulnerabilities CVE-2024-32002, CVE-2024-32004 and CVE-2024-32465
The current Nginx version running is 1.18.0. It seems like the Nginx version from the default Ubuntu repositories is still 1.18.0, which might not have the latest security patches. To resolve this, you can add the official Nginx repository to get the latest stable version. 1. Backup your...
Andrew Fletcher
•
09 Jun 2024
Overcoming startup challenges with Apache Solr on Ubuntu 24.04
Recently, after upgrading to Ubuntu 24.04, we encountered a significant challenge with our Apache Solr service—it refused to restart. This post documents the steps I took to diagnose and resolve the issues, providing a clear guide for anyone facing similar troubles. Initial troubleshootingThe...