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
Cannot save as png after packaging into exe file #69
Comments
What do you mean by "packing into exe file"? |
im on this problem too.
|
If the code works for regular Python, then there's nothing regarding this library at fault. It looks like the issue is with the tool you're using to generate exe files, so you need to report the issue with them (it might also be that you're misusing it, I honestly have no idea). I've never developed on windows, so I've no idea about the extra complexities around it. I don't have access to any Windows machines, so I can't really try it (nor do I have the time to research these tools, TBH). |
so apparently when changing to another font than the provided it works on windows. so when i changed to: self.font_path = os.path.join(PATH, "fonts", "calibri.ttf") it works, so maybe the error is because we dont have that font as stanard on windows. so when packaging to .exe alter the writer.py file to a font that is usable by the OS. |
Can you extract you |
I checked in the dist folder (which PyInstaller creates) but I couldn't find any traces of the barcode-code but I guess it is a problem within PyInstaller. But for those who have the issue either have to include the .ttf file in their code or just swap to something that is recognized by PyInstaller (like in my case when I swapped to calibri since I use that in the gui). Hopefully it could help anyone that tries to make an .exe with your module. |
Keep in mind that patching I haven't used The generated package / bundle should contain, at least, these files:
|
After reading some PyInstaller compiles the module (if I got that right) to a .pyc or .pyd file and somehow uses that in the .exe but that also means that the font file should be there somewhere, but then PyInstaller could have some trouble reading that I guess. Here is a PyInstaller dist folder with only PyInstaller and barcode in the venv. So I guess that the module is somewhere. |
I'd expect to see all the files form this module there too. Maybe inside |
I have the same error with pyinstaller and I was able to solve with adding following lines to added_files = [
("C:\\Program Files\\Python38\\Lib\\site-packages\\barcode\\fonts", 'barcode/fonts'),
]
a = Analysis(['b_test.py'],
pathex=['C:\\test'],
binaries=[],
datas=added_files,
... Anyway I would suggest to:
|
This error occurs under python3.6, how to solve it
The text was updated successfully, but these errors were encountered: