Then, I decide to pick pyinstaller because its document and relevant reference are concise.
Environment :
OS: Ubuntu 14.04Necessary packages and tools :
- wine (1.6.2)
- pyinstaller (2.1)
- virtual-wine (0.1)
- python-2.7.8.msi
- pywin32-218.win32-py2.7.exe
- PyQt4-4.11.4-gpl-Py2.7-Qt4.8.7-x32.exe
- lxml-2.3.win32-py2.7.exe
wine : $ apt-get install wine
pyinstaller : $ git clone https://github.com/pyinstaller/pyinstaller
virtual-wine : $ git clone https://github.com/htgoebel/virtual-wine.git
python-2.7.8 : Download from https://www.python.org/ftp/python/2.7.8/python-2.7.8.msi
pywin32-218.win32-py2.7 : Download from http://nchc.dl.sourceforge.net/project/pywin32/pywin32/Build%20218/pywin32-218.win32-py2.7.exe
PyQt4-4.11.4-gpl-Py2.7-Qt4.8.7-x32.exe: https://www.riverbankcomputing.com/software/pyqt/download
lxml-2.3.win32-py2.7.exe : Download from https://pypi.python.org/pypi/lxml/2.3/
Install packages to virtual env
Create a virtual wine environments using virtual-wine:
$ apt-get install scons
$ ./virtual-wine/vwine-setup venv_wine
Active virutal env:
$ . venv_wine/bin/activate
Use wine to install python packages to your virtual env:
$ wine msiexec -i python-2.7.8.msi
$ wine pywin32-218.win32-py2.7.exe
$ wine PyQt4-4.11.4-gpl-Py2.7-Qt4.8.7-x32.exe
$ wine lxml-2.3.win32-py2.7.exe
Build your python files using pyinstall under virtual environment
$ wine c:/Python27/python.exe pyinstaller/pyinstaller.py -D -F -n AppName -c "main.py"
The exe file will be located under dist directory
Check out my scripts, you will be more clear
Check out my script to setup the environment and make pyQt executable.https://github.com/tzutalin/labelImg/tree/master/build-tools
No comments:
Post a Comment