I try to run my Hamilton STAR with my Mac M1 Monterey 12.5. I saw here that it should be possible. I installed from source with all additional dependencies. If I connect my Mac via USB to Hamilton and try to open a communication I expect to not getting an error but I get:
Traceback (most recent call last):
File "/Users/maxhager/Projects2022/KiwiBiolab/PyLabRobot/test.py", line 9, in <module>
lh.setup()
File "/Users/maxhager/Projects2022/KiwiBiolab/PyLabRobot/pylabrobot/pylabrobot/liquid_handling/liquid_handler.py", line 104, in setup
self.backend.setup()
File "/Users/maxhager/Projects2022/KiwiBiolab/PyLabRobot/pylabrobot/pylabrobot/liquid_handling/backends/hamilton/STAR.py", line 404, in setup
self.dev = usb.core.find(idVendor=0x08af)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/usb/core.py", line 1309, in find
raise NoBackendError('No backend available')
usb.core.NoBackendError: No backend available
I saw that you used conda environment in your video. If someone is not using conda environment brew install libusb is not enough.
After brew install libusb it’s necessary to go into folder /opt/homebrew/Cellar/libusb/1.0.26/lib/ copy all the content and paste it into /usr/local/lib.
I’m glad that your solution worked. Since this is not something users should be expected to do, I am interested in identifying the root cause of the issue and I’m still not sure why brew install libusb did not work for you. Most likely, this is a libusb issue and not a PyLabRobot issue. I plan on looking into this more so that other users don’t encounter this.
Did you get any errors during the installation? What error did you get after installing and trying to use pyusb?
System Python should not have access to brew because it’s not in the path, right? Let us perhaps look again on the issue if another user should be confronted with it.
System Python is definitely in your path, but it may not have access to libraries imported with Homebrew. That would be my best guess given the current information.
FYI, it is generally not recommended to use system Python. See here and here, for example.