Repository navigation
'feast.ui_server' is not a package #4241
Copy link
Copy link
Closed
Labels
Description
Expected Behavior
feast ui command is starting without errors
Current Behavior
feast ui --host 127.0.0.1 --port 8889
/Users/aamoskalenko/0_root_folder/02_dev/35_feast_ui/venv/lib/python3.11/site-packages/feast/ui_server.py:45: DeprecationWarning:
on_event is deprecated, use lifespan event handlers instead.
Read more about it in the
[FastAPI docs for Lifespan Events](https://fastapi.tiangolo.com/advanced/events/).
@app.on_event("shutdown")
/Users/aamoskalenko/0_root_folder/02_dev/35_feast_ui/venv/lib/python3.11/site-packages/fastapi/applications.py:4495: DeprecationWarning:
on_event is deprecated, use lifespan event handlers instead.
Read more about it in the
[FastAPI docs for Lifespan Events](https://fastapi.tiangolo.com/advanced/events/).
return self.router.on_event(event_type)
Traceback (most recent call last):
File "/Users/aamoskalenko/0_root_folder/02_dev/35_feast_ui/venv/bin/feast", line 8, in <module>
sys.exit(cli())
^^^^^
File "/Users/aamoskalenko/0_root_folder/02_dev/35_feast_ui/venv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/aamoskalenko/0_root_folder/02_dev/35_feast_ui/venv/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/Users/aamoskalenko/0_root_folder/02_dev/35_feast_ui/venv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/aamoskalenko/0_root_folder/02_dev/35_feast_ui/venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/aamoskalenko/0_root_folder/02_dev/35_feast_ui/venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/aamoskalenko/0_root_folder/02_dev/35_feast_ui/venv/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/aamoskalenko/0_root_folder/02_dev/35_feast_ui/venv/lib/python3.11/site-packages/feast/cli.py", line 172, in ui
store.serve_ui(
File "/Users/aamoskalenko/0_root_folder/02_dev/35_feast_ui/venv/lib/python3.11/site-packages/feast/feature_store.py", line 2494, in serve_ui
ui_server.start_server(
File "/Users/aamoskalenko/0_root_folder/02_dev/35_feast_ui/venv/lib/python3.11/site-packages/feast/ui_server.py", line 105, in start_server
app = get_app(
^^^^^^^^
File "/Users/aamoskalenko/0_root_folder/02_dev/35_feast_ui/venv/lib/python3.11/site-packages/feast/ui_server.py", line 54, in get_app
ui_dir_ref = importlib_resources.files(__name__) / "ui/build/"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/python@3.11/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/resources/_common.py", line 22, in files
return from_package(get_package(package))
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/python@3.11/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/resources/_common.py", line 55, in get_package
raise TypeError(f'{package!r} is not a package')
TypeError: 'feast.ui_server' is not a package
Steps to reproduce
pip install feast==0.38.0
feast init test_ui # created a project
cd test_ui/feature_repo
feast apply -- OK
feast serve -p 8008 # started feast server 127.0.0.1:8008 -- OK
#in the same folder
feast ui --host 127.0.0.1 --port 8009 # I was trying different ports 8008, 8888 etc -- ERROR
Specifications
- Version: feast==0.38.0 , python3.11
- Platform: MacOs
- Subsystem:
Possible Solution
Reactions are currently unavailable
Activity
privatedumbo commentedon May 31, 2024
This happened to me to. The problem is related to
importlib_resources.Problem: this does not work with
importlib.resourcesSolution: install
importlib-resourcesTo validate this, you can run and it should work. I can PR:
shuchu commentedon May 31, 2024
The importlib of Python involves many changes and deprecations in newer Python versions. I would prefer to modify the code and catch the latest changes in importlib.resources
privatedumbo commentedon May 31, 2024
So you suggest fixing this using the built-in one, instead of installing importlib-resources?
tokoko commentedon May 31, 2024
I think I broke this, sorry about that :). changing
importlib_resources.files(__name__)withimportlib_resources.files('feast')should be a fix if I'm not mistaken. I was for some reason still not able to start the ui server with the change applied, but it seemed to fix theis not a packageerror. If anyone can verify it, would be a great help...privatedumbo commentedon May 31, 2024
v0.38.0
v0.37.1
For what I see, the difference is using the builtin vs the library. Not the package name
tokoko commentedon May 31, 2024
Yes, I made the change in #4109. The difference apparently is that
filesmethod in library expectsanchorfile path as a first parameter, while the same method in built-in expects a package name. I thought there were supposed to be drop-in replacements and missed that...privatedumbo commentedon May 31, 2024
Yes, should be TBH. I can PR this tomorrow if it helps.
Option A) we re-install the lib
Option B) we fix it using the built-in if possible
WDYT?
tokoko commentedon May 31, 2024
yup, I'd prefer fixing it with built-in if possible. importlib libraries are pretty popular and have caused diamond dependency problems before... so if there's a way to not depend on them, that would be a plus. thanks a lot
privatedumbo commentedon May 31, 2024
Good, agreed. Will come back tomorrow for this. Thanks for the ping-pong 🏓
shuchu commentedon May 31, 2024
yes, the Python built-in one is preferred as the discussion concluded.
privatedumbo commentedon Jun 1, 2024
PR raised here:
#4248
Annamalaisaravanan commentedon Jul 2, 2024
Follow this Video, This helped me a lot to crack and overcome this error: https://www.youtube.com/watch?v=rBJvW3AjmsM