diff --git a/FlatCAM.py b/FlatCAM.py index b66cfbf..a27f031 100644 --- a/FlatCAM.py +++ b/FlatCAM.py @@ -1,4 +1,9 @@ +import os import sys + +if hasattr(sys, 'frozen'): + os.environ['PATH'] = os.path.dirname(sys.executable) + os.pathsep + os.environ.get('PATH', '') + from PyQt4 import QtGui, QtCore from FlatCAMApp import App from multiprocessing import freeze_support diff --git a/make_win32.py b/make_win32.py index b829c6f..95d4ea9 100644 --- a/make_win32.py +++ b/make_win32.py @@ -6,6 +6,8 @@ import os, site, sys from cx_Freeze import setup, Executable +import glob, shutil, site +import numpy as np ## Get the site-package folder, not everybody will install ## Python into C:\PythonXX @@ -15,12 +17,18 @@ include_files = [] include_files.append((os.path.join(site_dir, "shapely"), "shapely")) include_files.append((os.path.join(site_dir, "svg"), "svg")) include_files.append((os.path.join(site_dir, "svg/path"), "svg")) -include_files.append((os.path.join(site_dir, "vispy"), "vispy")) +include_files.append((os.path.join(site_dir, "vispy-0.5.0.dev0-py2.7.egg/vispy"), "vispy")) include_files.append(("share", "share")) include_files.append((os.path.join(site_dir, "rtree"), "rtree")) include_files.append(("README.md", "README.md")) include_files.append(("LICENSE", "LICENSE")) +dll_cache = [ + ('dll_cache/geos.dll', 'geos.dll'), + ('dll_cache/geos_c.dll', 'geos_c.dll') +] +include_files.extend(dll_cache) + base = None # Lets not open the console while running the app @@ -31,17 +39,12 @@ buildOptions = dict( compressed=False, include_files=include_files, icon='share/flatcam_icon48.ico', - # excludes=['PyQt4', 'tk', 'tcl'] excludes=['scipy.lib.lapack.flapack.pyd', 'scipy.lib.blas.fblas.pyd', - 'QtOpenGL4.dll', 'tkinter'], + 'QtOpenGL4.dll', 'tkinter', 'collections.sys', 'collections.abc'], packages=['OpenGL'] ) -print "INCLUDE_FILES", include_files - -execfile('clean.py') - setup( name="FlatCAM", author="Juan Pablo Caram", @@ -50,3 +53,9 @@ setup( options=dict(build_exe=buildOptions), executables=[Executable("FlatCAM.py", base=base)] ) + +np_dll_dir = os.path.join(os.path.dirname(np.__file__), 'core') +target = r'build\exe.win-amd64-2.7' + +for dll in glob.glob(os.path.join(np_dll_dir, '*.dll')): + shutil.copy(dll, target) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 53c6515..4f8f86b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,13 @@ # This file contains python only requirements to be installed with pip -# Python pacakges that cannot be installed with pip (e.g. PyQT4) are not included. +# Python packages that cannot be installed with pip (e.g. PyQT4) are not included. # Usage: pip install -r requirements.txt -numpy>=1.8 -matplotlib>=1.3.1 -shapely>=1.3 +# Usage: python2 -m pip install -r requirements.txt + +matplotlib==1.4 +shapely==1.7.1 simplejson rtree scipy +svg.path==2.1.1 +pywin32==228 +cx_freeze==4.3.4 \ No newline at end of file