I'm using a Python application that accesses a USB device (pipsta printer) and executes a routine. It's running fine outside the container, but when it comes to the container it returns a error like this:
(File "usr/local/lib/python2.7/dist-packages/usb/backend/libusb0.py", line 386, in _check: raise USBError(errmsg, ret) USB.core.USBError: [Errno None] couldn't opendir(): No such a file or directory)
In my dockerfile, I've included all the packages relevant to Python and USB, and I also moved the relevant files to /etc/udev/rules.d and restarted udev.
I know this is an old question (I've only just encountered it). The following is a paraphrasing of the FAQ. The following steps should help diagnose the problem.
Examplesfolder.python verify_pipsta_install.py. This will try and help diagnose problems.The following will should fix the python usb library error.
pipsta/Examples/system_scripts/to/etc/udev/rules.d/60-ablesystems-pyusb.rulesIf the printer still fails to be discovered then -
The following workaround may work. 1. Unplug the printer from the USB port 1. Enter the command
sudo lsusb1. Reconnect the printer 1. Enter the commandsudo lsusbIf the printer has been detected by the Linux environment then either
/dev/ap1400or/dev/pipstashould exist in the filesystem.NOTE The Pipsta now has Debian packages to help with installation. I have a link limit on my account but search for
pipsta-printer-utilities-1.1.1-Linux.debandpipsta-cups-driver-0.3.0-armhf.debfor more information.