Questions tagged [pyz]

.pyz is the file extension dedicated for self-contained Python applications in a zip archive.

Python can run applications from self-contained ZIP files. They usually carry a file extension of .pyz for console tools or .pyzw for graphical programs, as specified by PEP-441.

They're similar in use to Java files, or Perl , and PHP archives.

  • However, they don't even require a manifest.

  • A __main__.py entry module is all that's needed for Python to run a ZIP application.

There are however tools to simplify building them:

  • zipapp as standard module in Python 3.5
  • pyzzer basically a zip frontend to inject a python #! shebang
  • makepyz from the original feature request
  • pex goes slightly beyond the plain ZIP format, can bundle whole distributions
8 questions
26
votes
1 answer

Gettext message catalogues from virtual dir within PYZ for GtkBuilder widgets

Is there an established approach to embed gettext locale/xy/LC_MESSAGES/* in a PYZ bundle? Specifically to have Gtks automatic widget translation pick them up from within the ZIP archive. For other embedded resources pkgutil.get_deta or…
mario
  • 144,265
  • 20
  • 237
  • 291
6
votes
1 answer

PYZ file extension

I have searched but can find no way to read PYZ files. I know they are a type of zip file, but I can not read them by way of a zip program. This is in reference to another question where I need access to the _init__ file inside a directory structure…
Praxis
  • 934
  • 2
  • 17
  • 31
2
votes
0 answers

Python 2 to Python 3 Conversion: Can't find __main__ module in pyz

I am working on porting a python2 project to python3 while keeping the compatibility with python2. I started fixing small things: indentation, print calls, some imports using six etc. The Makefile creates a zip archive with the python header…
Teodor
  • 21
  • 3
2
votes
2 answers

How to run a python script from a password protected zip

I know python modules/scripts can be run from within a zip archive, as outlined here: https://www.python.org/dev/peps/pep-0441/ and https://blogs.gnome.org/jamesh/2012/05/21/python-zip-files/ But my question is: Is it possible to password protect…
FuzzkingCool
  • 309
  • 4
  • 14
0
votes
0 answers

How to decompile a exe file made by pyinstaller

a desktop.exe made by pyinstaller. I want to decomplie it. I extracted it with pyinstxtractor.py. and ran desktop.pyc.there are some errors : ModuleNotFoundError: No module named 'xxxx'. I think that the mudules are compressed in PYZ-00.pyz. I…
Apollo
  • 1
0
votes
1 answer

How to use pyz file?

There is a pyz file that has all the dependency bundle I need (numpy, tensorflow....etc) I am wondering how do I run a function inside that pyz file. For example if there is a function called runJob I would like to call that function in my…
olaf
  • 239
  • 1
  • 8
0
votes
1 answer

Debug .pyz executable

When I run my main.py file from console like python main.py everything works just fine. However when I package the app with zippapp it opens up window and apparently shows some error which I am unable to read because it immediately closes. How to…
romanzdk
  • 930
  • 11
  • 30
0
votes
1 answer

Using a pyz containing pyc files on another machine

On a project I'm involved with, we package our python product using compileall.compile_dir on an Ubuntu 14.04 (using Python 3.4). The directories of pyc files and such are bundled (tar.gz file) and distributed. The filenames are altered to…
LawfulEvil
  • 2,267
  • 24
  • 46