It seems it's enough to pass `base_url` parameter to `GitHub` client. https://stackoverflow.com/questions/46524697/login-problems-using-pygithub At least it works for me. I think the ideal solution is to add extra config variable.