Hi Community! I tried to `pip install -U flytekit`...
# ask-the-community
g
Hi Community! I tried to
pip install -U flytekit
but got the error below:
Copy code
root@8c31a56d6646:/# pyflyte
Traceback (most recent call last):
  File "/usr/local/bin/pyflyte", line 5, in <module>
    from flytekit.clis.sdk_in_container.pyflyte import main
  File "/usr/local/lib/python3.8/dist-packages/flytekit/__init__.py", line 305, in <module>
    load_implicit_plugins()
  File "/usr/local/lib/python3.8/dist-packages/flytekit/__init__.py", line 299, in load_implicit_plugins
    discovered_plugins = entry_points(group="flytekit.plugins")
TypeError: entry_points() got an unexpected keyword argument 'group'
Does anyone can help to debug?
c
i recall an old conversation where someone was having troubles on python 3.8. dunno if that's what is happening here but you might want to try >3.9
g
What if we cannot change the version?
c
i just installed flytekit on python 3.8.18 and things work in my limited testing (
pyflyte info
), so if you're getting the error with a simple command i don't think it's related to py version
g
Gotcha
@Yee DO you have a clue Yee?
y
what version of python are you using?
oh 3.8
ummm… that’s not a flyte thing. that’s in import_lib
can you give me the precise version of python?
python --version
g
3.8.10
Thanks for the help!
y
i can’t find that exact one
Copy code
$ docker run -ti python:3.8-slim-buster bash
root@8a2499a9bba2:/# pip install importlib_metadata
Collecting importlib_metadata
  Downloading importlib_metadata-7.1.0-py3-none-any.whl (24 kB)
Collecting zipp>=0.5
  Downloading zipp-3.18.1-py3-none-any.whl (8.2 kB)
Installing collected packages: zipp, importlib_metadata
Successfully installed importlib_metadata-7.1.0 zipp-3.18.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: <https://pip.pypa.io/warnings/venv>

[notice] A new release of pip is available: 23.0.1 -> 24.0
[notice] To update, run: pip install --upgrade pip
root@8a2499a9bba2:/# python
Python 3.8.17 (default, Jun 13 2023, 12:24:40)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from importlib_metadata import entry_points
>>> entry_points(group="flytekit.plugins")
EntryPoints(())
could you check your version of
importlib_metadata
?
Copy code
pip show importlib_metadata
g
Name: importlib-metadata Version: 1.5.0
pip install -U importlib_metadata
then the pyflyte works!
Do we have a minimum required version for the importlib_metadata?
y
yeah… i think it used to be there too.
but i think we removed it for some reason.
also it’s not used 3.10 and later
g
I suggest we should add that in the lock requirement
y
unf we don’t have per python version requirements. i think this can be added to the pyproject toml file, but not sure how.
if either of you know, would you mind putting in a PR?
k
@Gilbert Yang I think if you propose a PR - i think you can by limiting it to python 3.8 https://github.com/flyteorg/flytekit/blob/e3f92cf748c7852164881bc566481dfe5b3d3e40/pyproject.toml#L12-L13