mabuchilab / Instrumental

Python-based instrumentation library from the Mabuchi Lab.
http://instrumental-lib.readthedocs.org/
GNU General Public License v3.0
117 stars 77 forks source link

fixes building for thorlabs kinesis devices #167

Open robotanik opened 8 months ago

robotanik commented 8 months ago

'ctypes.util.find_library' was not able to find the dll files so I added the path to the systempath

natezb commented 7 months ago

I'm hesitant to directly edit PATH in the code, which is hacky. The simplest solution would be to add a note in the docs to ensure your PATH is set correctly in the Windows environment.

Alternatively, we could consider migrating lib_name in nicelib.build.build_lib() to be more like header_info, i.e. allow specifying paths alongside filenames.

robotanik commented 7 months ago

For all I can see nicelib doesn't handle the lib_name like the header_info and expects the file in the current directory or in the directory where the files are build. As a fall-back is utilises ctypes.util.find_libraryto find the file, which fails if the directory is not in the PATH. See here and here I can add the requirement for the PATH in the documentation, but may I add a check if the directory is in the current system path that raises an descriptive exception if it is not?