Closed pranjal-joshi closed 2 years ago
Got it working by force downgrading the version to alive_progress==1.6.2
Yeah, maybe you could try to install the dependencies previously? grapheme
and about-time
.
Closing this as of now because it's working with a downgraded version. But, I will keep you posted about the updates.
OK, here we are @m1ch4elx and @Mettwasser. Care to explain exactly what are you doing, which commands are you using, etc?
OK, here we are @m1ch4elx and @Mettwasser. Care to explain exactly what are you doing, which commands are you using, etc?
So I'm only using alive_bar(). When using the newest version it drops that error (in the .exe - made with pyinstaller).
Hey! I'm getting that problem too, exactly this error... Any way to resolve that? Thank you! (:
Well, I don't know this PyInstaller, but I'm sure it is messing up grapheme install.
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/_MEIr3FD7j/grapheme/data/grapheme_break_property.json'
Since grapheme cannot find a required file it installed, perhaps that file got misplaced, or not put into the exe at all. I did a quick look into it, and that seems exactly the case. Here it is: https://pyinstaller.readthedocs.io/en/v4.10/operating-mode.html#analysis-finding-the-files-your-program-needs So, just include manually that file and it should work.
Seems pretty odd to put a required file in /tmp.
Is there any way to include grapheme using --hidden-imports
while packaging with pyinstaller?
U have to run this pyi-makespec --onefile start.py
in terminal with ur main.py file.
After that, put that line in the spec file after a block code
:
a.datas += Tree("<python_path>/Lib/site-packages/grapheme/", prefix= "grapheme")
a.datas += Tree("<python_path>/lib/site-packages/about-time/", prefix= "about-time")
Like that:
a = Analysis(['script.py'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
a.datas += Tree("<python_path>/Lib/site-packages/grapheme/", prefix= "grapheme")
a.datas += Tree("<python_path>/lib/site-packages/about-time/", prefix= "about-time")
Then, run pyinstaller spec file
and that's it!
You didn't understand @TheTechRobo. In order for this PyInstaller to run the exe, it seems to need to unzip all files it packed in a temp directory. Then, when grapheme ran, it tried to read an internal file that should be there, in its data dir, but the exe didn't include it... This is the error.
Anyway, thanks @balasclava!
It should be right on what you've sent! I see you've told it include both grapheme
and about-time
, which should cover everything 👍
Actually, since about-time
is also a project of mine, I'm sure it doesn't use any additional files, so it should be fine to remove that line.
I'm just waiting now for someone to confirm it works to close this, thanks!!
Hello everyone, for me the solution of @balasclava works!
Although i could not use the following path "
Thank you very much for the help.
I'm glad it worked, thanks!
CLI Just add grapheme data like pyinstaller -F "Hello World.py" --collect-all grapheme
Hello, I am shipping executables with PyInstaller. Even though I've enabled
hidden import
foralive-progress
/alive_progress
, The executable throws the following error during runtime.