So I tried building dxf2gcode on my Mac (OS X 10.11.6). I have made some progress, but still no cigar.
The first hurdle is that make_tr.py and make_py_uic.py don’t know about Mac OS/Darwin as a platform, so I had to tell them in lines 11 and 27, respectively, like this:
if "linux" in sys.platform.lower() or "unix" in sys.platform.lower() or "darwin" in sys.platform.lower():
Also, Mac OS doesn’t like \\ in path names, so in setup.py I had to change line 51 like this:
icon="images/DXF2GCODE-001.ico",
Another thing is that the paths to the dependencies (installed on my machine through Homebrew and Homebrew’s python3 in /usr/local/Cellar/python/ and /usr/local/opt/python and Qt5 in /usr/local/Cellar/qt/ and /usr/local/opt/qt/) are not found. I guess this is a problem of my environment, not of dxf2gcode.
In make_tr.py I added the path to the lrelease binary in line 16 like this:
names = ["/usr/bin/lrelease-qt5", "/usr/bin/lrelease5", "/usr/bin/lrelease", "/usr/local/opt/qt/bin/lrelease"]
In setup.py I had to change the path to PyOpenGL in line 21 like this:
path_base = "/usr/local/lib/python3.6/site-packages/OpenGL"
The remaining problem is that setup.py does not find QtCore (and some modules are reported as missing as well, see terminal output at the end of this message). It looks for the file here:
/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/QtCore.framework/Versions/5/QtCore
I guess this is because it derives this path from the path of the python installation used to execute setup.py (/usr/local/Cellar/python/). But on my machine, QtCore is actually here:
Tills-MacBook-Air:dxf2gcode-20170925 admin$ find /usr -iname QtCore
/usr/local/Cellar/qt/5.11.1/include/QtCore
/usr/local/Cellar/qt/5.11.1/lib/QtCore.framework/QtCore
/usr/local/Cellar/qt/5.11.1/lib/QtCore.framework/Versions/5/Headers/5.11.1/QtCore
/usr/local/Cellar/qt/5.11.1/lib/QtCore.framework/Versions/5/Headers/QtCore
/usr/local/Cellar/qt/5.11.1/lib/QtCore.framework/Versions/5/QtCore
/usr/local/lib/python3.6/site-packages/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore
I do not know how to tell setup.py the correct path to QtCore. Any ideas?
Thanks!
Till
Tills-MacBook-Air:dxf2gcode-20170925 admin$ python3 ./setup.py bdist_dmg
running bdist_dmg
running bdist_mac
running build
running build_exe
Missing modules:
? OpenGL.platform.PLATFORM imported from OpenGL.GLU.glunurbs, OpenGL.GLU.quadrics, OpenGL.GLU.tess, OpenGL.raw.GL._errors, OpenGL.raw.GL._types
? OpenGL.platform.createBaseFunction imported from OpenGL.GLU.quadrics, OpenGL.GLU.tess
? OpenGL_accelerate imported from OpenGL.acceleratesupport
? OpenGL_accelerate.arraydatatype imported from OpenGL.arrays.arraydatatype, OpenGL.arrays.arrayhelpers, OpenGL.converters
? OpenGL_accelerate.errorchecker imported from OpenGL.error
? OpenGL_accelerate.latebind imported from OpenGL.latebind, OpenGL.wrapper
? OpenGL_accelerate.vbo imported from OpenGL.arrays.vbo
? OpenGL_accelerate.wrapper imported from OpenGL.arrays.arrayhelpers, OpenGL.converters, OpenGL.wrapper
? PyQt4 imported from core.arcgeo, core.project, core.shape, dxf2gcode__main__, dxfimport.geoent_arc, dxfimport.geoent_circle, dxfimport.geoent_line, dxfimport.importer, globals.config, globals.constants, gui.aboutdialog, gui.arrow, gui.canvas, gui.canvas2d, gui.configwindow, gui.messagebox, gui.popupdialog, gui.routetext, gui.treehandling, gui.treeview, gui.wpzero, postpro.postprocessor, postpro.postprocessorconfig, postpro.tspoptimisation
? PyQt4.QtCore imported from gui.configwindow, postpro.breaks
? PyQt4.QtGui imported from dxf2gcode__main__, dxfimport.importer, gui.aboutdialog, gui.arrow, gui.canvas, gui.canvas2d, gui.configwindow, gui.messagebox, gui.popupdialog, gui.routetext, gui.treehandling, gui.treeview, gui.wpzero, postpro.postprocessor
? StringIO imported from globals.six
? __main__ imported from bdb, pdb
? _abcoll imported from globals.ordereddict
? _dummy_threading imported from dummy_threading
? _frozen_importlib imported from importlib, importlib.abc
? _frozen_importlib_external imported from importlib, importlib._bootstrap, importlib.abc
? _winapi imported from subprocess
? _winreg imported from platform
? compiler imported from globals.configobj.configobj
? dummy_thread imported from globals.ordereddict
? dxf2gcode_ui4 imported from dxf2gcode__main__
? java.lang imported from platform
? msvcrt imported from subprocess
? nt imported from ntpath, os, shutil
? numpy imported from OpenGL.arrays.vbo
? org.python.core imported from copy, pickle
? os.path imported from os, pkgutil, py_compile, tracemalloc, unittest, unittest.util
? thread imported from globals.ordereddict
? vms_lib imported from platform
? winreg imported from mimetypes, platform
This is not necessarily a problem - the modules may not be needed on this platform.
Copying data from package OpenGL...
Copying data from package PyQt5...
error: [Errno 2] No such file or directory: '/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/QtCore.framework/Versions/5/QtCore'