AW: Installing python librarries for use within rlm_python
Poltorak, Paul (CT DD DS EVO O BFD TM&ISEC 1)
Paul.Poltorak at evosoft.com
Mon Oct 31 14:24:46 CET 2016
Have the same issue.
Use SLES12SP1 with source installed 3.0.12.
At beginning I configured in "/usr/local/etc/raddb/mods-enabled/python" the python_path with "python_path =${modconfdir}/python:/usr/lib64/python2.7/".
Then I need MySQLdb for that I have to expand python_path to "python_path =${modconfdir}/python:/usr/lib64/python2.7/:/usr/lib64/python2.7/site-packages/".
MySQLdb need math so I have to add "lib-dynload" so my current python_path is now "python_path =${modconfdir}/python:/usr/lib64/python2.7/:/usr/lib64/python2.7/site-packages/:/usr/lib64/python2.7/lib-dynload/"
This is just only happening in freeradius.
Did not find other solution right now, maybe it helps you.
BR
Paul
> 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__"
> 1.1.3
>
> 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),
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
More information about the Freeradius-Users
mailing list