Jump to content

As of July 17, 2015, the LabJack forums here at forums.labjack.com are shut down. New registrations, topics, and replies are disabled. All forums are in a read-only state for archive purposes.

Please visit our current forums at labjack.com/forums to view and make new posts. To post on the current forums, use your labjack.com login account. Your old LabJack forums login credentials have been retired. There are no longer separate logins for labjack.com and LabJack forums.


Photo

Python Module Not Working!


  • Please log in to reply
2 replies to this topic

#1 jleeman

jleeman
  • Members
  • 2 posts

Posted 07 July 2010 - 10:54 AM

All,
I can use the examples in the exodriver fine, but when I type import U6 (my module) at the command line I get the following:
>>> import u6
<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): no suitable image found.  Did find:
	/usr/local/lib/liblabjackusb.dylib: mach-o, but wrong architecture
Any ideas? I'm running Snow Leopard on an iMac 2.8GHz dual core with 2GB ram.

Thank you!

#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 07 July 2010 - 11:29 AM

/usr/local/lib/liblabjackusb.dylib: mach-o, but wrong architecture


You have a 32-/64-bit problem. From what I can infer, you compiled the Exodriver yourself. When you compile it yourself with the default Makefile, you build a 64-bit Exodriver. Confirm this by running:

$ file /usr/local/lib/liblabjackusb.dylib 
/usr/local/lib/liblabjackusb.dylib: Mach-O 64-bit dynamically linked shared library x86_64

This usually isn't a problem (it's how I have my current Exodriver), unless you need to use it from a 32-bit application. Snow Leopard comes with a combined 32- and 64-bit Python:

$ file /usr/bin/python
/usr/bin/python: Mach-O universal binary with 3 architectures
/usr/bin/python (for architecture x86_64):	Mach-O 64-bit executable x86_64
/usr/bin/python (for architecture i386):	Mach-O executable i386
/usr/bin/python (for architecture ppc7400):	Mach-O executable ppc

So my guess is that you're using a different installation of Python, one that you downloaded and installed yourself. The one from python.org, for example, is 32-bit only. Does this sound familiar? What do you get when you run?

$ which python

If it's not "/usr/bin/python", what do you get when you run?

$ file `which python`


To fix the problem, you have at least two options. First, you could use the built-in python. That would require reinstalling LabJackPython where the built-in python can find it. Run something like

$ cd path/to/LabJackPython/src
$ /usr/bin/python setup.py install

Second, you could install a combined 32-/64-bit Exodriver and replace the 64-bit only version you have. Compiling the Exodriver for both platforms is easy (just edit one line in the Makefile), but the Exodriver depends on libusb, and compiling libusb for 32- and 64-bit systems is harder. Fortunately, we did the work for you. The "Exodriver (native USB) Mac OS X installer" on this page:

http://labjack.com/s...ac-os-x-drivers

contains 32-/64-bit copies of the Exodriver and libusb. You should remove the copies you have already (in /usr/local/lib) to be safe if you want to use this installer.

#3 jleeman

jleeman
  • Members
  • 2 posts

Posted 08 July 2010 - 03:50 AM

Great! I use EPD so that was indeed the issue and your suggestions solved the problem. Thank you for your assistance and fantastic support!


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users