Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

importlib.metadata.PackageNotFoundError Error on any interaction with pywalfox binary #5

Open
TrimVis opened this issue May 5, 2024 · 2 comments

Comments

@TrimVis
Copy link

TrimVis commented May 5, 2024

Hi, I opened an issue on the wrong repo first, so here it is in the hopefully correct location this time.

I installed pywalfox through the AUR using paru -S python-pywalfox (As documented here )
Initially it worked great, but after a system upgrade I am now receiving the following error (on any interaction with the pywalfox binary):

Traceback (most recent call last):
  File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 397, in from_name
    return next(cls.discover(name=name))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/pywalfox", line 33, in <module>
    sys.exit(load_entry_point('pywalfox==2.7.4', 'console_scripts', 'pywalfox')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/pywalfox", line 22, in importlib_load_entry_point
    for entry_point in distribution(dist_name).entry_points
                       ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 862, in distribution
    return Distribution.from_name(distribution_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 399, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: No package metadata was found for pywalfox

This seems like a packaging issue (as its complaining about missing package metadata), but I never really worked with python packaging, so this is just a wild guess. I'm running Python 3.12.3 (I think this changed during the update)

I tried reinstalling the package, but the issue still persists.
It seems that you are also the maintainer of the AUR package, so I hope this is the right location to report this issue.

In case you need any other specs about my environment feel free to tell me, I didn't really see a Issue Template, so I hope everything is fine :)

@kumpelblase2
Copy link

Actually ran into the same issue just now, but I remembered this is often caused by the package being built for a previous python. If you run pacman -Ql python-pywalfox you'll see which files where installed where for the package. This also includes the python version, as you can see in this except:

...
python-pywalfox /usr/lib/python3.11/
python-pywalfox /usr/lib/python3.11/site-packages/
python-pywalfox /usr/lib/python3.11/site-packages/pywalfox-2.7.4-py3.11.egg-info/
python-pywalfox /usr/lib/python3.11/site-packages/pywalfox-2.7.4-py3.11.egg-info/PKG-INFO
python-pywalfox /usr/lib/python3.11/site-packages/pywalfox-2.7.4-py3.11.egg-info/SOURCES.txt
...

I built it for python 3.11, while in the meantime python was updated to 3.12. Thus you need to rebuild the package using the currently installed python version. If you used paru before, you can run paru -S --rebuild python-pywalfox, which should rebuild the package and then also re-install it.

Probably should increase the package version (not sure if that's the right descriptor, I'm referring to the last version part in the full version string) in the AUR such that it will trigger rebuilds for everyone.

@TrimVis
Copy link
Author

TrimVis commented May 6, 2024

Running paru -S --rebuild python-pywalfox worked!
Thanks a lot for your help :)

I tried googling real quick if there is a mechanism, but on first glance I couldn't see anything besides updating the release number 🤔
I think for now its the proper step to do :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants