This problem, "Could not load the Exodriver driver", occurs with the latest OS X version and with an up-to-date Exodriver installed.
$ python PulserScript.py
<class 'LabJackPython.LabJackException'>: Could not load the Exodriver driver. Ethernet connectivity only.
Check that the Exodriver is installed, and the permissions are set correctly.
The error message was: dlopen(liblabjackusb.dylib, 6): image not found
The permissions appear to be correct.
$ ls -lah /usr/local/lib
-rwxr-xr-x 1 root wheel 93K 1 May 2013 liblabjackusb-2.5.2.dylib
lrwxr-xr-x 1 root wheel 40B 12 Jul 19:04 liblabjackusb.dylib -> /usr/local/lib/liblabjackusb-2.5.2.dylib
-rwxr-xr-x 1 root wheel 225K 20 Sep 2012 libusb-1.0.0.dylib
lrwxr-xr-x 1 root wheel 33B 12 Jul 19:04 libusb-1.0.dylib -> /usr/local/lib/libusb-1.0.0.dylib
Both python and liblabjackusb.dylib are universal 32/64 bit versions.
$ file /usr/bin/python
/usr/bin/python: Mach-O universal binary with 2 architectures
/usr/bin/python (for architecture i386): Mach-O executable i386
/usr/bin/python (for architecture x86_64): Mach-O 64-bit executable x86_64
$ file /usr/local/lib/liblabjackusb.dylib
/usr/local/lib/liblabjackusb.dylib: Mach-O universal binary with 3 architectures
/usr/local/lib/liblabjackusb.dylib (for architecture i386): Mach-O dynamically linked shared library i386
/usr/local/lib/liblabjackusb.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
/usr/local/lib/liblabjackusb.dylib (for architecture ppc): Mach-O dynamically linked shared library ppc
What else could be wrong? Do the PATH or other environment variables need to include the liblabjackusb.dylib location?
What are the permissions of your /usr/local/lib directory? The file permissions look fine, but directory permissions can cause issues as well. Look at our response on this forum topic as it discusses what to check and what command to run if you need to correct directory permissions:
https://labjack.com/forums/u3/new-user-need-help-getting-started
I am having the same problem. My permissions are the same.
<class 'LabJackPython.LabJackException'>: Could not load the Exodriver driver. Ethernet connectivity only.
Check that the Exodriver is installed, and the permissions are set correctly.
The error message was: dlopen(liblabjackusb.dylib, 6): image not found
Traceback (most recent call last):
File "test.py", line 11, in <module>
devices = u3.openAllU3()
File "/Library/Python/2.7/site-packages/u3.py", line 51, in openAllU3
for i in range(deviceCount(3)):
File "/Library/Python/2.7/site-packages/LabJackPython.py", line 1233, in deviceCount
return staticLib.LJUSB_GetDevCount(devType)
AttributeError: 'NoneType' object has no attribute 'LJUSB_GetDevCount'
In a terminal run:
ls -l /usr/local
And double check that the lib directory has correct permissions as well. If that doesn't help resolve the issue, what version of Mac OS X / macOS are you running?
This is what I get.
Alexs-MBP:~ alexchiem$ ls -l /usr/local
total 8
drwxrwxr-x 3 alexchiem admin 102 May 22 14:27 Cellar
drwxrwxr-x 2 alexchiem admin 68 May 22 14:26 Frameworks
drwxrwxr-x 17 alexchiem admin 578 May 22 14:26 Homebrew
drwxr-xr-x 4 alexchiem admin 136 Nov 18 2015 apache-maven
drwxrwxr-x 81 alexchiem admin 2754 May 22 14:26 bin
drwxr-xr-x 4 alexchiem admin 136 Dec 10 14:24 etc
drwxr-xr-x 20 alexchiem admin 680 Dec 2 2015 go
drwxrwxr-x 27 alexchiem admin 918 May 24 17:42 include
drwxrwxr-x 106 alexchiem admin 3604 May 24 17:50 lib
drwxr-xr-x 4 alexchiem admin 136 Jan 7 2015 man
lrwxr-xr-x 1 alexchiem admin 26 Nov 19 2015 mysql -> mysql-5.7.9-osx10.9-x86_64
drwxr-xr-x 13 alexchiem admin 442 Nov 19 2015 mysql-5.7.9-osx10.9-x86_64
drwxrwxr-x 3 alexchiem admin 102 May 22 14:27 opt
drwxrwxr-x 2 alexchiem admin 68 May 22 14:26 sbin
drwxrwxr-x 11 alexchiem admin 374 May 22 14:27 share
drwxrwxr-x 3 alexchiem admin 102 May 22 14:26 var
I am running OS X El Capitan 10.11.2.
Try the latest LabJackPython on GitHub and see if it helps:
https://github.com/labjack/LabJackPython
I updated it to attempt to load the Exodriver with full path if the normal load fails. We have ran into cases with other customers having issues sometimes where the default library paths on the system does not include /usr/local/lib, and this was one solution for it without having to do additional installs or modifying a system setting.
If the latest LabJackPython doesn't resolve the issue, did you install Exodriver with our installer or did you build it from source code? If by source code, 64-bit Python needs a 64-bit Exodriver build and 32-bit Python needs a 32-bit Exodriver build. Otherwise our Exodriver installer installs both a 32-bit and 64-bit Exodriver.
Hi,
I installed it through the the Exodriver installer not source code.
Thank you
When I just import u3 from the python shell, this is what I get.
>>> import u3
<class 'LabJackPython.LabJackException'>: Could not load the Exodriver driver. Ethernet connectivity only.
Check that the Exodriver is installed, and the permissions are set correctly.
The error message was: dlopen(/usr/local/lib/liblabjackusb.dylib, 6): image not found
Hi,
After reinstalling everything, I got it to run but it only runs once then I get an error. I have to unplug it and plug it in again for it to run again.
Alexs-MBP:prog_vr_sw alexchiem$ python prog_vr.py
Setting initial values for VOUT domains...
Setting r_sense...
SW value: 3921.56862745, HW value: 1000000
Setting r_shunt...
SW value: 1000.0, HW value: 2500
Setting r_set...
SW value: 9960.78431373, HW value: 20000
Voltage VOUT0: (-0.000125, 'volts')
-0.000125
Current VOUT0: (-0.00015937499999999998, 'amps')
Alexs-MBP:prog_vr_sw alexchiem$ python prog_vr.py
Traceback (most recent call last):
File "prog_vr.py", line 689, in <module>
i2c_addr=I2C_MUX_ADDR
File "prog_vr.py", line 63, in __init__
devices = u3.openAllU3()
File "build/bdist.macosx-10.11-intel/egg/u3.py", line 56, in openAllU3
File "build/bdist.macosx-10.11-intel/egg/u3.py", line 102, in __init__
"""
File "build/bdist.macosx-10.11-intel/egg/u3.py", line 137, in open
"""
File "build/bdist.macosx-10.11-intel/egg/LabJackPython.py", line 602, in open
return False
File "build/bdist.macosx-10.11-intel/egg/LabJackPython.py", line 1367, in openLabJack
try:
File "build/bdist.macosx-10.11-intel/egg/LabJackPython.py", line 1446, in _makeDeviceFromHandle
elif firstFound:
IndexError: list index out of range
Before exiting your application make sure to close the device so the USB handle is freed. Mac OS X doesn't automatically free USB handles when an application closes. If you do not close the handle, the device is still claimed by the system and you can't close it programmatically in different/new process. A power cycle is needed in this case.
I was experiencing a similar error, where despite installing everything using the proper installers any time I tried to run "import u3" it would give me the below error:
>>> import u3
<class 'LabJackPython.LabJackException'>: Could not load the Exodriver driver. Ethernet connectivity only.
Check that the Exodriver is installed, and the permissions are set correctly.
The error message was: dlopen(liblabjackusb.dylib, 6): image not found
I decided that since I installed the LabJackPython package with pip I would try downloading from GitHub and see if things changed. Initially it gave me the same error, but I entered it again just to make sure and it works. Now the import function doesn't give error warnings the second time I call it every time, but there are obviously still problems since the U3 constructor still gives me errors:
>>> import u3
<class 'LabJackPython.LabJackException'>: Could not load the Exodriver driver. Ethernet connectivity only.
Check that the Exodriver is installed, and the permissions are set correctly.
The error message was: dlopen(liblabjackusb.dylib, 6): image not found
>>> import u3
>>> d = u3.U3()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/u3.py", line 98, in __init__
self.open(**kargs)
File "/usr/local/lib/python2.7/site-packages/u3.py", line 133, in open
Device.open(self, 3, firstFound = firstFound, serial = serial, localId = localId, devNumber = devNumber, handleOnly = handleOnly, LJSocket = LJSocket )
File "/usr/local/lib/python2.7/site-packages/LabJackPython.py", line 639, in open
d = openLabJack(devType, ct, firstFound = True, handleOnly = handleOnly, LJSocket = LJSocket)
File "/usr/local/lib/python2.7/site-packages/LabJackPython.py", line 1469, in openLabJack
handle = _openLabJackUsingExodriver(deviceType, firstFound, pAddress, devNumber)
File "/usr/local/lib/python2.7/site-packages/LabJackPython.py", line 1330, in _openLabJackUsingExodriver
openDev = staticLib.LJUSB_OpenDevice
AttributeError: 'NoneType' object has no attribute 'LJUSB_OpenDevice'
As you can see, it's pretty bizarre. Just for reference, here are all the things you asked the above people for:
- I installed Exodriver from the MacOSX installer, although originally I installed from the source (maybe this is the route of the problem?).
- All of the C examples in the source code function properly and give output.
- library permissions
ls -l /usr/local
total 0
drwxrwxr-x 40 samanthajensen admin 1360 Jul 31 14:18 Cellar
drwxrwxr-x 3 samanthajensen admin 102 Jul 5 11:07 Frameworks
drwxrwxr-x 17 samanthajensen admin 578 Jul 31 14:15 Homebrew
drwxrwxr-x 181 samanthajensen admin 6154 Jul 31 14:18 bin
drwxrwxr-x 6 samanthajensen admin 204 Jul 5 11:08 etc
drwxrwxr-x 80 samanthajensen admin 2720 Aug 4 14:50 include
drwxrwxr-x 165 samanthajensen admin 5610 Aug 4 14:50 lib
drwxr-xr-x 5 root wheel 170 Mar 29 2013 man
drwxrwxr-x 51 samanthajensen admin 1734 Jul 31 14:18 opt
drwxr-xr-x 3 root wheel 102 Jun 12 17:38 remotedesktop
drwxrwxr-x 2 samanthajensen admin 68 Jun 30 14:42 sbin
drwxrwxr-x 38 samanthajensen admin 1292 Aug 3 15:06 share
drwxrwxr-x 4 samanthajensen admin 136 Jul 5 11:06 var
-python versions
file /usr/bin/python
/usr/bin/python: Mach-O universal binary with 2 architectures: [x86_64: Mach-O 64-bit executable x86_64] [i386: Mach-O executable i386]
/usr/bin/python (for architecture x86_64): Mach-O 64-bit executable x86_64
/usr/bin/python (for architecture i386): Mach-O executable i386
- liblabjackusb.dylib versions
file /usr/local/lib/liblabjackusb.dylib
/usr/local/lib/liblabjackusb.dylib: Mach-O universal binary with 3 architectures: [i386: Mach-O dynamically linked shared library i386] [x86_64: Mach-O 64-bit dynamically linked shared library x86_64] [ppc: Mach-O dynamically linked shared library ppc]
/usr/local/lib/liblabjackusb.dylib (for architecture i386): Mach-O dynamically linked shared library i386
/usr/local/lib/liblabjackusb.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64/usr/local/lib/liblabjackusb.dylib (for architecture ppc): Mach-O dynamically linked shared library ppc
It looks like there is still an issue with finding the Exodriver library (liblabjackusb.lib) on your system. If permissions is not an issue (yours look fine), the current development version on GitHub has a Mac fix to force the library load to search in /usr/local/lib. Judging from this error:
dlopen(liblabjackusb.dylib, 6): image not found
The version you installed from pip or from our LabJackPython page is still being used, and not the GitHub version. In the newer version that error would instead mention "dlopen(/usr/local/lib/liblabjackusb.dylib, 6)" if the library could not be found.
With "pip uninstall", uninstall LabJackPython as there might be a conflict by using two different installation methods. Then reinstall the GitHub version and see if that helps. If not, go into your Python's site-packages directory and manually delete the following files:
Modbus.py / .pyc
skymote.py / .pyc
u3.py / .pyc
u6.py / .pyc
u12.py / .pyc
ue9.py / .pyc
LabJackPython-<VERSION-DATA>.egg-info
And then reinstall with the GitHub Version. When installing "python setup.py install", it will tell you where the site-packages directory is.
Thanks for your prompt answer! It was indeed still using the pip version.