3

When I imported sys,

>>> import sys
>>> sys.path
['', 'C:\\Program Files\\Python 3.5\\lib\\site-packages\\pyinstaller-3.0-py3.5.egg', **'C:\\Program Files\\Python 3.5\\python35.zip'**, 'C:\\Program Files\\Python 3.5\\DLLs', 'C:\\Program Files\\Python 3.5\\lib', 'C:\\Program Files\\Python 3.5', 'C:\\Program Files\\Python 3.5\\lib\\site-packages', 'C:\\Program Files\\Python 3.5\\lib\\site-packages\\win32', 'C:\\Program Files\\Python 3.5\\lib\\site-packages\\win32\\lib', 'C:\\Program Files\\Python 3.5\\lib\\site-packages\\Pythonwin']`

I checked whether there is a file like python34.zip in the directory, but the answer is no. Why is it showing?

Insane Skull
  • 9,220
  • 9
  • 44
  • 63

1 Answers1

1

The whole lib folder included in a Python installation can be zipped in an archive, named python3x.dll, with x depending on your Python release.

This is useful if you need to work whith a minimal, standalone, dedicated version of Python for some project, and helps if you intend to redistribute Python with your application, so users don't need to install Python to run it.

starting from Python 3.5, you can download an official embeddable version for windows, with a zipped python35.zip included - and no lib folder obviously.

Actually, I didn't test to zip a 3.4 release or below, yet, but I will soon. directions should be : compile every py to pyc or pyo, remove pycache folders, remove any libraries you don't need(*), check stackoverflow and python doc.

(*) you can use apps like Process Monitor, it will tell you which file are used by python during your app runtime.

jerome
  • 183
  • 2
  • 14