okta / okta-sdk-python

Apache License 2.0
239 stars 142 forks source link

Error importing Client in 2.9+ #350

Closed harry-uglow closed 1 year ago

harry-uglow commented 1 year ago

When importing the Client we're encountering the following error now that we're using version 2.9.1:

Traceback:
pipelines/okta/tasks.py:9: in <module>
    from okta.client import Client as OktaClient
venv/lib/python3.9/site-packages/okta/client.py:25: in <module>
    from okta.request_executor import RequestExecutor
venv/lib/python3.9/site-packages/okta/request_executor.py:4: in <module>
    from okta.oauth import OAuth
venv/lib/python3.9/site-packages/okta/oauth.py:2: in <module>
    from okta.jwt import JWT
venv/lib/python3.9/site-packages/okta/jwt.py:2: in <module>
    from Cryptodome.PublicKey import RSA
E   ModuleNotFoundError: No module named 'Cryptodome'

This is reproducible in a fresh Python client simply by running from okta.client import Client.

At the moment we've fixed this by locking our dependency to 2.8.x - any help in resolving this would be appreciated.

justinabrokwah-okta commented 1 year ago

Hey @harry-uglow, is just running the 1 line causing the error? Have you tried uninstalling and reinstalling the package completely? I'm not able to reproduce this issue locally

harry-uglow commented 1 year ago

Hi, thanks for the response. Yes, worth noting that this happens on our CI runner as well which installs all its packages from scratch.

fernandoreyez commented 1 year ago

can confirm this is an issue with latest release and using 2.7.x release works.

frozb commented 1 year ago

Hi, we also have this issue.

The problem seems to be with https://github.com/okta/okta-sdk-python/pull/345

The new package is missing in setup.py

justinabrokwah-okta commented 1 year ago

Thanks for the inputs @harry-uglow , @fernandoreyez , @fer-roz-d

Great catch @fer-roz-d , I'll create a PR to add it in there as well

bretterer commented 1 year ago

This should be resolved in 2.9.2 which is now released and in Pypi