vstadnytskyi / thorlabs_motion_control

BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

FileNotFoundException: Unable to find assembly 'Thorlabs.MotionControl.Controls'. at Python.Runtime.CLRModule.AddReference(String name) #3

Open vstadnytskyi-FDA opened 2 years ago

vstadnytskyi-FDA commented 2 years ago
In [1]: from thorlabs_motion_control.driver_LTS150 import LongTravelStage
D:\GitHub\thorlabs_motion_control\thorlabs_motion_control\examples\LTS150.py:96: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if __name__ is "__main__":
D:\GitHub\thorlabs_motion_control\thorlabs_motion_control\examples\LTS150.py:96: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if __name__ is "__main__":
---------------------------------------------------------------------------
FileNotFoundException                     Traceback (most recent call last)
Input In [1], in <cell line: 1>()
----> 1 from thorlabs_motion_control.driver_LTS150 import LongTravelStage

File D:\GitHub\thorlabs_motion_control\thorlabs_motion_control\__init__.py:6, in <module>
      3 __version__ = get_versions()['version']
      4 del get_versions
----> 6 from .examples.LTS150 import LongTravelStage
      7 from . import driver_LTS150

File D:\GitHub\thorlabs_motion_control\thorlabs_motion_control\examples\LTS150.py:21, in <module>
     18 sys.path.append(r"C:\Program Files\Thorlabs\Kinesis")
     19 serial = '45252134'
---> 21 clr.AddReference("Thorlabs.MotionControl.Controls")
     22 import Thorlabs.MotionControl.Controls
     24 clr.AddReference("Thorlabs.MotionControl.DeviceManagerCLI")

FileNotFoundException: Unable to find assembly 'Thorlabs.MotionControl.Controls'.
   at Python.Runtime.CLRModule.AddReference(String name)
vstadnytskyi-FDA commented 2 years ago

In the example as it is coded at the moment there is dependency.

You need to manually point at the location of ThorLabs Kinesis DLL files see example below.

# constants
sys.path.append(r"C:\Program Files\Thorlabs\Kinesis")
serial = '45252134'
vstadnytskyi-FDA commented 1 year ago

And you need to make sure to download and install Kinesis from ThorLabs webpage https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=10285