Installation¶
Install the bs120xenet package from PyPi with pip or similar:
$ pip install bs120xenet
The Python library depends on the C/C++ library. See C/C++ Driver Installation for instructions.
C/C++ Driver Installation¶
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.
Windows¶
The simplest way to install the driver on Windows is to use the MSI installer.
This will by default install the library to 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 System32
for some other reason, you may place the DLLs wherever you like using the zip archive download option.
For details, see Using a Custom Location.
Linux¶
For most systems, directly copying the downloaded directories into /usr/local should do the
trick. It’s not advised to directly install the driver into /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 Using a Custom Location.
Using a Custom Location¶
If you choose to install the library to a custom location and Bs120xEnet() doesn’t
automatically find it, you can manually tell it where you put the library. For example:
with Bs120xEnet(lib="C:/Users/me/path/to/bs120xenet.dll") as client:
pass
with Bs120xEnet(lib="/home/me/path/to/libbs120xenet.so") as client:
pass
Linux Alternative: Using LD_LIBRARY_PATH¶
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 libbs120xenet.so is present in the LD_LIBRARY_PATH
environment variable, Bs120xEnet() should be able to find it and load it
automatically.
For more information, see ld.so(8).