Problem in import sqlite3 library in freeradius python module

Mehrzad Moghaddas mehrzadmo at
Sun Mar 3 14:44:51 CET 2019


I have tried to use sqlite3 library in freeradius 3.0.16 python module on
ubuntu 18.04 . I have installed freeradius via standard repositories .
but I got this error message :

reading pairlist file /etc/freeradius/3.0/mods-config/files/pre-proxy
  # Instantiating module "linelog" from file
  # Instantiating module "log_accounting" from file
  # Instantiating module "python" from file
Python version: 2.7.15rc1 (default, Nov 12 2018, 14:31:15)  [GCC 7.3.0]
python_function_load - Module 'example' not found
<type 'exceptions.ImportError'> (No module named sqlite3)
python_function_load - Failed to import python function
/etc/freeradius/3.0/mods-enabled/python[9]: Instantiation failed for module

any other library its ok -like os socket and etc -  ! just have problem
with sqlite3 !

there is my config files :
mods-avalaible > python :

python {
        #  Path to the python modules
        #  Note that due to limitations on Python, this configuration
        #  item is GLOBAL TO THE SERVER.  That is, you cannot have two
        #  instances of the python module, each with a different path.


        module = example

mods-config > python >

import radiusd
import sqlite3


def get_acls():
  cur=con.execute("SELECT * FROM acl")
  for acl in acls :

I test python 2.7 and 3 but no differences , I tried installed freeradius
from source -freeradius 3.0.19-

what should I do ?

More information about the Freeradius-Users mailing list