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

pkg_resources Module not foun, py3.12 #131

Closed
EBGlom opened this issue Dec 6, 2024 · 7 comments · Fixed by #132
Closed

pkg_resources Module not foun, py3.12 #131

EBGlom opened this issue Dec 6, 2024 · 7 comments · Fixed by #132
Assignees

Comments

@EBGlom
Copy link
Collaborator

EBGlom commented Dec 6, 2024

Describe the bug
qats application fails to start as pgk_resources module is not found
NB: this is on an old repo with potentially some historical files here and there, but the poetry env is brand new (py 3.12.4)

To Reproduce
write qats app in terminal (see screenshot)

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image

Desktop (please complete the following information):

  • OS: W 10

Additional context
Will seek some work-arounds and report back

@tovop
Copy link
Collaborator

tovop commented Dec 6, 2024

Hi! No time today but I'll have a look at it soon. Keep me posted.

@tovop
Copy link
Collaborator

tovop commented Dec 6, 2024

I believe there is generally a problem with pkg_resources on 3.12. I think @eneelo has encountered this some time ago.

@eneelo
Copy link
Collaborator

eneelo commented Dec 6, 2024

As I recall, we removed dependencies to pkg_resources related to getting version info, but two other imports/usages remain:
image

This issue seems to be addressed in mu-editor/mu#2485, and documentation on how to migrate to importlib_resources is provided in https://importlib-resources.readthedocs.io/en/latest/migration.html#pkg-resources-resource-filename. Looks like an easy fix, unless there is some twist I don't see immediately.

@EBGlom
Copy link
Collaborator Author

EBGlom commented Dec 6, 2024

Seeming functioning work-around in py 3.12:

cli.py:
image

gui.py:
image
and
image

QIcon is not fond of pathlib type arguments

@eneelo
Copy link
Collaborator

eneelo commented Dec 6, 2024

That's good! I didn't see your last post before establishing a new branch and PR to test this solution. See #132

@EBGlom
Copy link
Collaborator Author

EBGlom commented Dec 6, 2024

Didn't expect this speedy turn-around here :)

I had to use importlib.resources (py 3.12 only).
image

I pushed a minor update which catches the ImportError

@tovop
Copy link
Collaborator

tovop commented Dec 6, 2024

Lovely! Quickly solved @eneelo and @EBGlom

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

Successfully merging a pull request may close this issue.

3 participants