python-thread / thread

A Python threading library extension ⭐️ Star to support our work!

Home Page:https://thread.ngjx.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

importlib.metadata.PackageNotFoundError Nuitka

Abdullah-Albanna opened this issue · comments

Bug report

Your issue may already be reported!
Please check out our active issues before creating one.

Expected Behavior

It should work with Nuitka just fine

Current Behavior

I get importlib.metadata.PackageNotFoundError: No package metadata was found for thread

Is this a regression?

Possible Solution

They say it might be the metadata thing

Steps to Reproduce (for bugs)

  1. Nuitka issues 1793

Context

I'm trying to include thread in my nuitka build because it has things I want, but cannot because of this

Your Environment

  • Version used: 2.0.4
  • Python version:3.11
  • Link to your project: still working on it
  • Operating System and version (desktop or mobile):Windows 10

@Abdullah-Albanna
Hey, thanks for raising this. I'll have a look into it.

If you could provide a step by step to reproduce this, it would also help :>

@caffeine-addictt
If you just use the thread module normally

and compile it with nuitka (any version would trigger this), you would get this error once upon opening the newly compiled binary.

now I do know that it is fixable to just use an older version of python (3.6 and below), I haven't tested it yet though.

Pretty sure is because of metadata.distribution and metadata_distribution!.

I'd love this getting fixed, I think thread is awesome

@Abdullah-Albanna
Thanks.

Perhaps it's a windows thing?
I tested compiling and running on archlinux on python3.11 and python3.13. No issues.

@caffeine-addictt
might, I'll try on arch and mac right now

@Abdullah-Albanna

If its still non-reproducible, I'm willing to revert back to manually incrementing the version numbers.

(I seriously need to create an auto increment script 🤣)

@Abdullah-Albanna

It's also compiling and running perfectly fine on python3.11 on my windows machine.

Are you using nuitka latest version?

@caffeine-addictt

Okay, my other machines are acting weird, couldn't compile on it :(

anyway, I found out that it works if compiled without the --standalone

compile yours like so, nuitka --standalone py_file.py

you'd see that error

@Abdullah-Albanna

Ah, I see. I can reproduce it now.

@caffeine-addictt

Yeah, you should try with an older version of python and work you way from there to see what's wrong with it

@Abdullah-Albanna

If its still non-reproducible, I'm willing to revert back to manually incrementing the version numbers.

(I seriously need to create an auto increment script 🤣)

Think I'll go with this. Tested it out with v2.0.1, the last version before I had importlib resolve the version number, and it compiles with the standalone flag

@caffeine-addictt

Great, that works.

@Abdullah-Albanna

I'll be including the patch in v2.0.5 (#143).
Feel free to reopen this issue if the issue still persists :>

Again, thanks for your contribution〜

@Abdullah-Albanna

Merged 4608b55.

And it's up on PyPI now.

pip install thread==2.0.5

@caffeine-addictt

That's awesome, loving it 😁