forked from robotsinthesun/monkeyprint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwindowsPackaging
51 lines (42 loc) · 2.53 KB
/
windowsPackaging
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
These are the steps for creating a packaged version for Windows.
Build OS: Windows 7 64 bit
Build for 64 bit:
* Download and install Python-2.7 (64 bit version)
* Download from [here](python.org/downloads)
* Make sure to set the "Add to path"-option during install
* Download and install PyWin32 (64 bit version)
* Download from [here](github.com/mhammond/pywin32/releases)
* Download Microsoft C++ Redistributables
* vcredist_x86.exe (why not x64_86?)
* Install
* Install dependencies from Christoph Gohlkes archive
* Download packages from [here](https://www.lfd.uci.edu/~gohlke/pythonlibs/)
* Numpy
* OpenCV 2.4
* zmq
* VTK 5.10
* PyQt4
* Pillow
* pyserial
* Install each of them using pip install <package-name>
* Install pyInstaller using pip -install pyinstaller
* Add paths to C:\Python27\Libs\site-packages\vtk / Qt4 etc to PATH
* Better (????): Add path to C:\Python27\Libs\site-packages to PATH
* Modify C:\Python27\Libs\PyInstaller\hooks\hook-pythonvtk.py to C:\Python27\Libs\site-packages\PyInstaller\hooks\hook-vtk.py and comment last two lines of C:\Python27\Libs\site-packages\vtk\__helper.py
according to [this](https://stackoverflow.com/questions/21835851/python-executable-with-vtk-pyinstaller-py2exe-cx-freeze-etc) Otherwise vtk will not be imported correctly during packaging
* Copy C:\Python27\Libs\site-packages\zmq\libzmq.pyd to C:\Python27\Libs\site-packages\zmq\backend\cython according to [this issue](https://github.com/zeromq/pyzmq/issues/999)
* Finally, run pyinstaller --onefile monkeyprint.spec from monkeyprint directory
* Copy monkeyprint.exe from the dists/monkeyprint folder to the base dir and delete dists and build folders
* monkeyprint.exe is ready to ship
Build for 32 bit:
* Run all of the steps as above with the following exceptions:
* During Python install
* Set install directory to C:\Python27x86
* Make sure that "Install extensions" is not checked
* Make sure that "Add to path" is not checked
→ This will install Python 32 bit to it's own directory without interfering with the 64 bit installation
* Download the 32-bit version of PyWin32
* Download the 32-bit libraries fomr Christoph Gohlkes archive
* Install them using C:\Python27x86\Scripts\pip.exe install <package-name> so they end up in the 32 bit python directory
* Install pyInstaller with C:\Python27x86\Scripts\pip.exe install pyinstaller
* *Replace* the package locations in PATH to point to C:\Python27x86 instead of C:\Python27. This seems kind of hacky, dependencies should probably be included in the spec file in the future...