looker-open-source / sdk-codegen

One SDK to rule them all, and in the codegen bind them
MIT License
232 stars 195 forks source link

Python SDK v24.18.0 can't import looker_sdk #1518

Closed wsjk closed 2 weeks ago

wsjk commented 3 weeks ago

Unable to run import looker_sdk anymore since new Python SDK release

% python
Python 3.10.15 (main, Oct  3 2024, 02:24:49) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import looker_sdk
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/xxxxx/anaconda3/envs/mwaa251/lib/python3.10/site-packages/looker_sdk/__init__.py", line 25, in <module>
    from looker_sdk.rtl import api_settings
ModuleNotFoundError: No module named 'looker_sdk.rtl'
>>> 
hendrixtlan commented 3 weeks ago

a temporary workaround could be install a previous version: !pip install looker-sdk==23.2.0 import looker_sdk

jeremytchang commented 3 weeks ago

I have a fix here: https://github.com/looker-open-source/sdk-codegen/pull/1521

For those in this thread, can you try installing the python sdk from the branch and confirm in this thread it works? The pip command should be:

pip install 'looker-sdk @ git+https://github.com/looker-open-source/sdk-codegen.git@fix_py_setup#subdirectory=python'

You'll need to uninstall the original looker-sdk in your pip first:

pip uninstall looker-sdk

The above installation instructions, or downgrading to 24.16.0 should suffice as a workaround until we release this change.

nilsjesper commented 3 weeks ago

@jeremytchang - installing from that branch worked for me (I was seeing the .rtl error before)

mosquire commented 2 weeks ago

@jeremytchang Installing from that branch fixed this issue for me too