3
votes

I am trying to convert my python script (python 2.7.13) to an executable using Pyinstaller 3.2.1. In my script I am using libraries from Pywin32-220

import win32com.client
import win32com.shell
import win32event
import win32gui
import win32process
import win32api

when I check the generated directory of the executable, I find that pyinstaller copied files like Pythonwin.exe and PyWin32.chm and folders like Demos and win32comext which don't have anything to do with my executable. It is more like that pyinstaller simply copied the directory of pywin into my excutable.

My question is, is there a way in (.spec file for example) to tell pyinstaller to not include such files and folders?

A side note: I was using Pyinstaller 2.1 before and it wasn't including any of these files/folders not even bundling them inside the generated exe. This is how I know that they are unnecessary.

1

1 Answers

0
votes

I figured out why it was doing this behavour. I was installing pywin exe using easy_intall using a batch file that creates a virtualenv and install some other required packages for my project. the easy_install option installs pywin in a single directory inside the site-packages folder. I have then downloaded the whl file and used pip install instead. It installed the pywin32 the same as when one install it using the excutable. running pyinstaller now only retrieves the necessary files and not the whole folder.