Installing python librarries for use within rlm_python

Shabda Raaj shabda.raaj at
Mon Oct 31 13:36:37 CET 2016

I have radius 3.0.13 installed and working with rlm_python. I am able
to send a RLM_MODULE_OK from within the authorize function.

In my sites-enabled I have

python {
  module = example
  python_path = ${modconfdir}/${.:name}
  mod_authorize = ${.module}
  func_authorize = authorize

I have installed sqlalchemy, a Python library and it is correctly
installed; as I can see from

$ python -c "import sqlalchemy; print sqlalchemy.__version__"

However when I try using it inside of my file being called from
rlm_python, I am getting

Python version: 2.7.12 (default, Jul  1 2016, 15:12:24)  [GCC 5.4.0 20160609]

System exec is

python_function_load - Module 'example' not found

<type 'exceptions.ImportError'> (No module named sqlalchemy)

python_function_load - Failed to import python function 'example.authorize'

/usr/local/etc/raddb/mods-enabled/python[1]: Instantiation failed for
module "python"

Is the python binary being used by rlm_python different from the system binary?

My radiusd version is

radiusd: FreeRADIUS Version 3.0.13 (git #7758e73),

More information about the Freeradius-Users mailing list