Dobot Python Demo Not Working


#1

Hi guys,

I am trying to make the robot python demo work from the Demo 2.0 folder, however, I keep getting the following errors:

dlopen(libDobotDll.dylib, 10): Library not loaded: @rpath/QtSerialPort.framework/Versions/5/QtSerialPort Referenced from: /Users/saed/Downloads/DobotDemoV2.0/DobotDemoForPython/libDobotDll.dylib Reason: image not found

I have copied the DLL for Mac files in the same folder, and I can see the libDobotDll.dylib, however it still can’t find it.

Any help would be great.

Thanks.


#2

You will most likely have to compile the .dylib from the source code using qt


#4

Did this work for anyone? Running into the same issue


#5

Hi saed.

The cause of the error is the library refer to wrong library path.
So you need to refer to correct path.(I don’t know that this way is recommend.)

At first, you should run below code. And check the path which is referenced.

$ otool -L libDobotDll.dylib

Maybe you get libDbotDll.dylib paths contain @rpath.
@rpath isn’t working well. So you must change these path.

Second, run below commands.

$ install_name_tool -change @rpath/QtSerialPort.framework/Versions/5/QtSerialPort /Users/saed/youcopied directly/QtSerialPort libDobotDll.dylib

And, you have to run command for QtNetwork and QtCore in the same way.

At the last, check the library path the first way.


#6

I get same error. But I cannot run the cmd you gave successful. Any other ideas ? how to get rid of @rpath


#7

Actually it worked for me now

  1. Deleted the old Xcode

  2. $ install_name_tool -change @rpath/QtSerialPort.framework/Versions/5/QtSerialPort /Users/saed/youcopied directly/QtSerialPort libDobotDll.dylib

  3. repeat for QtNetwork and QtCore.

But seems the APIs in Python lib are diff than in Dobot GUI tool. Like Home CMD takes the arm to different location


#8

Hi, how do we do this? Thanks


#9

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

  1. QtCore.framework
  2. QtNetwork.framework
  3. 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!