marcospereirampj / python-keycloak

MIT License
692 stars 296 forks source link

ImportError: cannot import name 'KeycloakOpenID' from 'keycloak' #575

Open fedorenko-dmitriy opened 1 month ago

fedorenko-dmitriy commented 1 month ago

Hi guys I got the error 'ImportError: cannot import name 'KeycloakOpenID' from 'keycloak'' Some times this error fixed by reinstalling the module pip uninstall python-keycloak / pip install python-keycloak. And some times need remove all venv. The behaviour very strange.

But when I try use pyinstaller through circleci this problem rise again

File "src\auth\auth_service.py", line 2, in <module> ImportError: cannot import name 'KeycloakOpenID' from 'keycloak'

auth_service.py from keycloak import KeycloakOpenID

circleci config

Any ideas?

ryshoooo commented 1 month ago

can you share your requirements.txt? I expect you have another package included like keycloak or keycloak-client. These packages collide with python-keycloak, see f.e. https://github.com/marcospereirampj/python-keycloak/issues/559

fedorenko-dmitriy commented 1 month ago

@ryshoooo yeh! you are totally right it was 'keycloak'!!! Thx very much. I spent a lot of time trying find this problem. Thx a lot!