Hey guys, I've been experimenting with packaging a...
# questions
m
Hey guys, I've been experimenting with packaging a Kedro project using the
kedro package
command and I am running into an issue. First off, I am attempting to running it like this:
Copy code
from <my-package>.__main__ import main
main(
    ["--tags", "<my-tags>", "--env", "base"]
)
Is this correct?
Copy code
When I do try to run it like this, the following error is raised:
ImportError: cannot import name 'TypeAliasType' from 'typing_extensions' (/databricks/python/lib/python3.10/site-packages/typing_extensions.py)
File <command-3656540420037005>, line 2 1 from <my-package>.__main__ import main ----> 2 main( 3 ["--tags", "int_tms_hotel_reservations", "--env", "base"] 4 )

File /local_disk0/.ephemeral_nfs/envs/pythonEnv-30b382f4-147d-466f-a67b-6ce8dcc92265/lib/python3.10/site-packages/sqlalchemy/util/typing.py:56 54 from typing_extensions import TypeGuard as TypeGuard # 3.10 55 from typing_extensions import Self as Self # 3.11 ---> 56 from typing_extensions import TypeAliasType as TypeAliasType # 3.12 58 _T = TypeVar("_T", bound=Any) 59 _KT = TypeVar("_KT")
How can I overcome this? I tried upgrading the version of the
typing-extensions
package without any luck. The current version of this package installed on my cluster is 4.12.2. I am running this project on Databricks and I think it is best to avoid running the package using
python -m ..
. That is why I am looking for a Python option. I am using Kedro 0.19.4.
👀 1
r
Hi @Minura Punchihewa, The usage of kedro package looks fine to me. There might be some compatibility issues with python, typing_extensions and sqlalchemy. I am checking on this. Just to confirm, you have python (3.10), typing-extensions (4.12.2) and sqlalchemy (??) Also, I found this which might be worth trying. Thank you
m
Oh, apologies for not letting you know, but I was able to solve this. I had to run
dbutils.library.restartPython()
and it worked. I am not entirely sure why though.
👍 1