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 ['/usr/local/etc/raddb/mods-config/python'] 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', '/usr/lib/python2.7/lib-dynload', '/home/ubuntu/.local/lib/python2.7/site-packages', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages'] This behaviour is being caused by PySys_SetPath(path); https://github.com/FreeRADIUS/freeradius-server/blob/ce92146386b30bd7f9f5768... 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; path=Py_GetPath(); newpath=new char[strlen(path)+4]; strcpy(newpath, path); strcat(newpath, ":."); // ":." for unix, or ";." for windows PySys_SetPath(newpath); free(newpath);
Which gets the old path from Py_GetPath, and then appends to it.