Skip to main content

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 Fletcher17 Aug 2022

How To Install Apache Solr 8.11 on Ubuntu

In this article I'll walk through the steps I went through to install Solr on Ubuntu.   Step 1: Java Check if Java is installed on your server: java -version Not there - then Java is the first step for you to set up for Solr.  JAVA SE 8 or Later is required to run...
Andrew Fletcher17 Aug 2022

How To Install Apache Solr 8.11 on CentOS/RHEL 7

Looking to install Solr on your server?  Not sure if it worth the effort?  Well, Apache Solr is the open-source, popular, super fast open source enterprise search platform from the Apache Lucene project.  Written in Java, Solr is highly scalable, providing fault-tolerant distributed...