Installing python librarries for use within rlm_python

Shabda Raaj shabda.raaj at
Tue Nov 1 04:49:12 CET 2016

> Your python environment is broken. Most likely, your python home is in a non-standard location

I don't think so.  "which python" gives me /usr/bin/python on the shell.

I think I have figured out the problem, and I think it is a bug in the
rlm_python code.

I put a "import sys; print sys.path" in my python file. This gives me a


Which is wrong, because it should have also contained the default path:

['', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu',
'/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old',

This behaviour is being caused by


Which sets the pythonpath to that hardcoded path, rather than appending to it.

I think the correct code would be along these lines

char *path, *newpath;
newpath=new char[strlen(path)+4];
strcpy(newpath, path);
strcat(newpath, ":.");  // ":." for unix, or ";." for windows


Which gets the old path from Py_GetPath, and then appends to it.

More information about the Freeradius-Users mailing list