Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6334

Thorlabs Kinesis killing Jupyter kernel

$
0
0

I am trying to use a Python script in a Jupyter notebook to control a Thorlabs Kinesis Position Aligner. My colleague wrote the script and it works fine on their computer, but when I run it, the kernel dies and throws the error "The kernel appears to have died. It will restart automatically."

The part of the code in question is shown below. (It is sufficient to test problem if Kinesis is installed.) It requires having Thorlabs Kinesis software installed, which I do, and have checked that Kinesis runs the device properly. As far as I can tell all of the packages and permissions are the same on my computer as on my colleague's.

import clr #pip install pythonnet for this.import sysimport timeimport numpy as npfrom System import Stringfrom System import Decimalfrom System.Collections import *sys.path.append(r"C:\Program Files\Thorlabs\Kinesis") #double checked that this is correct location# add .net reference and import so python can see .netclr.AddReference("Thorlabs.MotionControl.Controls")import Thorlabs.MotionControl.Controls   #this line kills the kernelclr.AddReference("Thorlabs.MotionControl.DeviceManagerCLI")clr.AddReference("Thorlabs.MotionControl.GenericPiezoCLI")clr.AddReference("Thorlabs.MotionControl.KCube.PositionAlignerCLI")clr.AddReference("Thorlabs.MotionControl.KCube.PiezoCLI")from Thorlabs.MotionControl.DeviceManagerCLI import *  #these three imports work finefrom Thorlabs.MotionControl.GenericPiezoCLI import *from Thorlabs.MotionControl.KCube.PositionAlignerCLI import *

The line import Thorlabs.MotionControl.Controls seems to be the one killing the kernel. The other imports below it seem to work fine.

I have tried:

  • Updating numpy,
  • Updating Anaconda,
  • Uninstalling and reinstalling Anaconda as both local user and admin.

Help and suggestions greatly appreciated.


Viewing all articles
Browse latest Browse all 6334

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>