Thursday, March 27, 2014

Configuring Pyinstaller

1. Install Python 2.7
a. https://www.python.org/download/releases/2.7.6
2. Create a folder for all your scripts
a. C:\bin
3. Install PyWin32
a. http://sourceforge.net/projects/pywin32/files/
b. Select pywin32 and the latest build.
c. Choose the installer for your system
i. Processor architecture
ii. Python version
d. Execute the installer
i.

4. Install Pip-Win
a. https://sites.google.com/site/pydatalog/python/pip-for-windows
b. Download current version and move to your scripts folder (C:\bin)
c. Run the executable following the directions
d. When the Pip-Win window opens, enter the following command and hit run:
i. venv -c -i  pyi-env-name



e. A new command window opens.  Run the following command within this window:
i. pip install PyInstaller



f. The previous task will finish setting up the environment.  Subsequent sessions require you to open pip-Win with the following parameters for the run command:
i. venv pyi-env-name



5. Creating a Windows executable.
a. Launch pip-Win
i. Use venv pyi-env-name in the run command
ii. Ensure your python script is in the c:\bin folder
iii. Use the following command:
(pyi-env-name) C:\bin>Pyinstaller --onefile test.py
iv. Browse to the following folder for .exe
1) C:\bin\dist


No comments:

Post a Comment