4

I am trying to build documentation in readthedocs for a python module. In my python module, I import libusb using command import libusb. libusb package requires a libusb-1.0-0 Debian package which is usually installed via sudo apt install libusb-1.0-0.

It seems the readthedocs server doesn't have libusb-1.0-0. Hence I get the following message in readthedocs:

  File "/home/docs/checkouts/readthedocs.org/user_builds/strym/envs/latest/lib/python3.7/site-packages/usb1/__init__.py", line 61, in <module>
    from . import libusb1
  File "/home/docs/checkouts/readthedocs.org/user_builds/strym/envs/latest/lib/python3.7/site-packages/usb1/libusb1.py", line 199, in <module>
    libusb = _loadLibrary()
  File "/home/docs/checkouts/readthedocs.org/user_builds/strym/envs/latest/lib/python3.7/site-packages/usb1/libusb1.py", line 173, in _loadLibrary
    return dll_loader('libusb-1.0' + suffix, **loader_kw)
  File "/home/docs/.pyenv/versions/3.7.3/lib/python3.7/ctypes/__init__.py", line 356, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libusb-1.0.so: cannot open shared object file: No such file or directory

As a result, my documentation is not generated. How should I fix this?

1 Answers1

4

Responding to @eric-wiener

I had given up on that and later I changed my requirements for not to need libusb. However, now that my understanding has become richer, I can suggest doing something like this: Add the following lines to the .travis.yml file:

before_install: 
    - sudo apt-get -y install libusb-1.0-0-dev

Let me know if it works. If it works then I can mark this as an accepted answer.