Install the bs120xenet package from PyPi with pip or similar:
$ pip install bs120xenet
The Python library depends on the C/C++ library. See :ref:`native-installation` for instructions.
This library depends on the native C/C++ library. First, download the appropriate zip file for your platform or the Windows MSI installer from the latest release.
The simplest way to install the driver on Windows is to use the MSI installer. This will by default install the library to :file:`C:/Program Files[(x86)]/Bloomy Controls/bs120xenet`. The Python library will find it automatically.
If you do not have administrator priviledges or would prefer not to place files in :file:`System32` for some other reason, you may place the DLLs wherever you like using the zip archive download option. For details, see :ref:`custom-location`.
For most systems, directly copying the downloaded directories into :file:`/usr/local` should do the trick. It's not advised to directly install the driver into :file:`/usr`, as your system package manager should be in charge of that. For example:
$ sudo cp -r include lib* /usr/local/
If you wish to install the library to a custom location, see :ref:`custom-location`.
If you choose to install the library to a custom location and :func:`~bs120xenet.Bs120xEnet` doesn't automatically find it, you can manually tell it where you put the library. For example:
.. tab:: Windows
.. code-block:: python
with Bs120xEnet(lib="C:/Users/me/path/to/bs120xenet.dll") as client:
pass
.. tab:: Linux
.. code-block:: python
with Bs120xEnet(lib="/home/me/path/to/libbs120xenet.so") as client:
pass
On Linux, there is an alternative to the above example which leaves your Python code unchanged
(and therefore keeps it portable) but still allows you to install the library wherever you
please: LD_LIBRARY_PATH.
As long as the directory containing :file:`libbs120xenet.so` is present in the LD_LIBRARY_PATH
environment variable, :func:`~bs120xenet.Bs120xEnet` should be able to find it and load it
automatically.
For more information, see :manpage:`ld.so(8)`.