Building upon tkr1205’s answer just to make it a bit more clearer…
First, ensure that your terminal directory is the same directory as the ‘DobotDemoForPython’ folder, where DobotControl.py, libDobotDll.dylib files (among others) are located.
By using otool to see the shared libraries used by libDobotDll.dylib:
% otool -L libDobotDll.dylib
Output:
libDobotDll.dylib:
libDobotDll.1.dylib (compatibility version 1.0.0, current version 1.0.0)
@rpath/QtSerialPort.framework/Versions/5/QtSerialPort (compatibility version 5.6.0, current version 5.6.0)
@rpath/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.6.0, current version 5.6.0)
@rpath/QtCore.framework/Versions/5/QtCore (compatibility version 5.6.0, current version 5.6.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.5.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.50.2)
We can see that there 3 entries that begin with @rpath which I believe are substituting the wrong path. So the solution is to change those 3 entries to the absolute path based on where you installed your dobot demos folder.
Inside your DobotDemoForPython folder you should have 3 folders
- QtCore.framework
- QtNetwork.framework
- QtSerialPort.framework
The files you need to point to lie in these folders (one in each folder).
To do that use the 3 commands below, remembering to change the 2nd path to your own absolute paths to those files (located inside the Demo folder).
% install_name_tool -change @rpath/QtSerialPort.framework/Versions/5/QtSerialPort /Users/path/to/your/demo-magician-mac-os-master/DobotDemoForPython/QtSerialPort.framework/Versions/5/QtSerialPort libDobotDll.dylib
% install_name_tool -change @rpath/QtNetwork.framework/Versions/5/QtNetwork /Users/path/to/your/demo-magician-mac-os-master/DobotDemoForPython/QtNetwork.framework/Versions/5/QtNetwork libDobotDll.dyli
% install_name_tool -change @rpath/QtCore.framework/Versions/5/QtCore /Users/path/to/your/demo-magician-mac-os-master/DobotDemoForPython/QtCore.framework/Versions/5/QtCore libDobotDll.dylib
Then, when you run
% otool -L libDobotDll.dylib
You should get some output similar to below:
libDobotDll.dylib:
libDobotDll.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/Users/path/to/your/demo-magician-mac-os-master/DobotDemoForPython/QtSerialPort.framework/Versions/5/QtSerialPort (compatibility version 5.6.0, current version 5.6.0)
/Users/path/to/your/demo-magician-mac-os-master/DobotDemoForPython/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.6.0, current version 5.6.0)
/Users/path/to/your/demo-magician-mac-os-master/DobotDemoForPython/QtCore.framework/Versions/5/QtCore (compatibility version 5.6.0, current version 5.6.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.5.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.50.2)
After this, I was able to run DobotControl.py and see the Magician move!