Open 0-MegaMind-0 opened 3 years ago
from guessit import guessit
import sys
def main():
filename = sys.argv[1]
print(guessit(filename))
if __name__ == "__main__":
main()
It can be replicated by making this simple program a executable onefile using nuitka
python -m nuitka --follow-imports --onefile --linux-onefile-icon __main__.png __main__.py
Did you manage to get it working?
I also got your error, but your fix worked, so thanks for that.
But now I get another error:
ModuleNotFoundError: No module named 'babelfish.converters.alpha2'
The only thing importing babelfish is guessit, so did you also get this error? If yes, could you please tell me how you fixed it?
@Pfuenzle you'll need to use follow-imports and use the include package-dir
and data-dir
more more info read their entire documentation
--follow-imports
--include-plugin-directory=~/venv_path/lib/python3.8/site-packages/babelfish/
--include-data-dir=~/venv_path/lib/python3.8/site-packages/babelfish/data=babelfish/data
--include-data-dir=~/venv_path/lib/python3.8/site-packages/guessit/data=guessit/data
--include-data-dir=~/venv_path/lib/python3.8/site-packages/guessit/config=guessit/config
--include-plugin-directory=~/venv_path/lib/python3.8/site-packages/guessit
Why not using official binaries available in release page ?
Why not using official binaries available in release page ?
Hey, this is for a package I built, which uses guessit to get the Title from file names. Since I had to send these to my friends who have never installed python in their life sending it as pip installable or whl package was out of the question.
So had to create a simple EXE. That's when I encountered this issue. I'm not exactly sure why we get a TypeError
but didn't have the time to debug and see what part actually triggers the issue, So never made a pull request for this and left this as a issue for others who might be having the same issue.
I understand, but there's also binary builds inside Github Release page, for Linux, MacOS and Windows.
Le lun. 29 nov. 2021, 23:06, MegaMind @.***> a écrit :
Why not using official binaries available in release page ?
Hey, this is for a package I built, which uses guessit to get the Title from file names. Since I had to send these to my friends who have never installed python in their life sending it as pip installable or whl package was out of the question. So had to create a simple EXE. That's when I encountered this issue. I'm not exactly sure why we get a TypeError but didn't have the time to debug and see what part actually triggers the issue, So never made a pull request for this and left this as a issue for others who might be having the same issue.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/guessit-io/guessit/issues/704#issuecomment-982066595, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI4TPRWGILBPVIW4ATC5PDUOP2M7ANCNFSM46XRORMA .
Oh yeah for many that would be the best solution but since I'm using the python guessit api that wouldn't work for me.
I see ... I don't see how it's possible. It seems args is empty, or wordlist are empty too and we don't get into loop that initialize the string.
When you apply your fix, are the roman numbers guessed properly ? For example, "Dummy.Season.III" should give season: 3
in output ? I assume it's more likely an issue related to nuitka, maybe it has some kind of "tree shaking" and it drops some global variables inside this module ?
Have you tried with latest release ? https://nuitka.net/posts/nuitka-release-0617.html
I see ... I don't see how it's possible. It seems args is empty, or wordlist are empty too and we don't get into loop that initialize the string.
When you apply your fix, are the roman numbers guessed properly ? For example, "Dummy.Season.III" should give
season: 3
in output ? I assume it's more likely an issue related to nuitka, maybe it has some kind of "tree shaking" and it drops some global variables inside this module ?
I revisited this recently and got the same error (using the latest version of nuitka)
So I decided to give this and try with the sample code posted above
$ ./test.bin Dummy.Season.III
MatchesDict([('title', 'Dummy'), ('season', 3), ('mimetype', 'application/x-iphone'), ('type', 'episode')])
even after applying my temp fix it does parse the info correctly.
I'm still not sure why after compiling with nuitka it has this error. It likely has something to do with nuitka's C compilation and the way it initializes each module import
I'm trying to create a onefile executable with
nuitka
. It achieves the similar result topyinstaller
onefile.but the generated executable gives me a executable error at the file where guessit is imported
This is the log generated and it points to:
https://github.com/guessit-io/guessit/blob/develop/guessit/rules/common/numeral.py#L28-#L51
I'm guessing when it does it it never gets any wordlists for some reason and tries to add
None
to'|'
For now i've simply managed to solved this by adding
not the most elegant solution but its working for now.
Did couple of tests on both
nuitka
generated executable and my python module for now both produce identical result so i'm guessing that change didn't effect much. But since I don't really know what that part of code is used in guessit for I'm not really sure if I'd encounter issues in future.