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
•
01 May 2024
Common commands used in Ubuntu - in progress
A growing list of commands I've used and what they do in no specific ordersudo snap install bw
ps aux | grep java
whoami
ip addr show
uptime
sudo apt update && sudo apt upgrade -y
cat /etc/os-release
sudo apt-get install needrestart
sudo reboot
sudo needrestart
sudo ckan sysadmin...
Andrew Fletcher
•
18 Apr 2024
No results showing for your Solr instance - solr.service: Failed with result 'exit-code'
When Solr is displaying results on the site, first step is to log in the server and check its status● solr.service - LSB: Controls Apache Solr as a Service
Loaded: loaded (/etc/init.d/solr; generated)
Active: failed (Result: exit-code) since Wed 2024-04-17 23:22:52 UTC; 6h ago
...
Andrew Fletcher
•
18 Mar 2024
Resolving CVE-2022-48624 less issue
To resolve the CVE-2022-48624 vulnerability on Ubuntu using Nginx, it's crucial to understand that the issue lies within the "less" package, not Nginx itself. The vulnerability affects "less" before version 606, where close_altfile in filename.c in less omits shell_quote calls for LESSCLOSE,...