I’m back again. I feel like I’m spamming the board here with dumb problems but here goes…see here for where this began: USB device not found error (potential macOS 15 issue?) - #10 by jonlaurent
In light of the above thread I’m now getting up and running with PLR on a brand new computer with macOS 14.7.
I installed PLR inside a virtual environment set up with pyenv with python 3.12.6. I following the standard instructions, cloning and nstalling from source, and then installing pyusb/libusb but have had a hell of a time getting PLR working after that.
At first I was getting No backend available
errors, and troubleshooting suggested the libusb
package was not visible to pyusb
or PLR
for some reason. After banging my head a few more times I found this post: Python on M1 MBP trying to connect to USB devices - NoBackendError: No backend available - Stack Overflow and tried the symlink fix, which bypassed the no backend
error, but now I have something else still related to libusb:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
File ~/.pyenv/versions/3.12.6/envs/automation-env/lib/python3.12/site-packages/usb/backend/libusb1.py:961, in get_backend(find_library)
960 if _lib_object is None:
--> 961 _lib = _load_library(find_library=find_library)
962 _setup_prototypes(_lib)
File ~/.pyenv/versions/3.12.6/envs/automation-env/lib/python3.12/site-packages/usb/backend/libusb1.py:287, in _load_library(find_library)
285 win_cls = None
--> 287 return usb.libloader.load_locate_library(
288 ('usb-1.0', 'libusb-1.0', 'usb'),
289 'cygusb-1.0.dll', 'Libusb 1',
290 win_cls=win_cls,
291 find_library=find_library, check_symbols=('libusb_init',))
AttributeError: module 'usb' has no attribute 'libloader'
During handling of the above exception, another exception occurred:
AttributeError Traceback (most recent call last)
Cell In[8], line 2
1 ## Connect to robot
----> 2 await lh.setup()
File ~/FutureHouse/Lab/Automation/pylabrobot/pylabrobot/liquid_handling/liquid_handler.py:144, in LiquidHandler.setup(self, **backend_kwargs)
...
966 # exception already logged (if any)
967 _logger.error('Error loading libusb 1.0 backend', exc_info=False)
968 return None
AttributeError: module 'usb' has no attribute 'libloader'
I had no problems getting PLR working with a new install in the past so I feel like I’ve majorly borked something here. Since this is a brand new computer I’m not above starting fresh once again if it will fix things