Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when closing Thorlabs CCS spectrometer #114

Open
graham-triggs opened this issue May 13, 2020 · 2 comments
Open

Exception when closing Thorlabs CCS spectrometer #114

graham-triggs opened this issue May 13, 2020 · 2 comments

Comments

@graham-triggs
Copy link

graham-triggs commented May 13, 2020

I'm getting this exception when my script finishes. I am successfully closing the spectrometer with the close() method (I think), as this error only appears after my whole script finishes. As it happens on closing it isn't a huge problem but I'd like to get it working correctly.
I'm using pyton 3.8 32bit and cloned the latest instrumental version. Everything else with using the spectrometer via instrumental seems to be working fine.
Thanks for any help!

Exception ignored in: <function CCS.__del__ at 0x12C646A0>
Traceback (most recent call last):
  File "C:\Users\Asus\AppData\Local\Programs\Python\Python38-32\lib\site-packages\instrumental_lib-0.6.dev0-py3.8-win32.egg\instrumental\drivers\spectrometers\thorlabs_ccs.py", line 170, in __del__
  File "C:\Users\Asus\AppData\Local\Programs\Python\Python38-32\lib\site-packages\instrumental_lib-0.6.dev0-py3.8-win32.egg\instrumental\drivers\spectrometers\thorlabs_ccs.py", line 189, in close
  File "C:\Users\Asus\AppData\Local\Programs\Python\Python38-32\lib\site-packages\nicelib\nicelib.py", line 1133, in __get__
  File "C:\Users\Asus\AppData\Local\Programs\Python\Python38-32\lib\site-packages\nicelib\nicelib.py", line 684, in __init__
  File "C:\Users\Asus\AppData\Local\Programs\Python\Python38-32\lib\site-packages\nicelib\nicelib.py", line 687, in _assign_signature
ImportError: sys.meta_path is None, Python is likely shutting down
@natezb
Copy link
Contributor

natezb commented May 18, 2020

Thanks for the report. Can you test if the error still occurs if you remove your call to close()? I'm wondering if this is because of a double-close or a more specific issue with __del__().

@aaronscode
Copy link

Just to add testament from a second person, I'm getting the same issue. I can recreate it with the following code:

from instrumental import instrument, list_instruments

paramsets = list_instruments(module='spectrometers')
daq = instrument(paramsets[0])

intensity, wavelength = (daq.take_data())
print(intensity)

which yields the following exception (basically the same as @graham-triggs):

Exception ignored in: <function CCS.__del__ at 0x00000222B1E0DE50>
Traceback (most recent call last):
  File "C:\Users\aaron\AppData\Local\Programs\Python\Python39\lib\site-packages\instrumental\drivers\spectrometers\thorlabs_ccs.py", line 171, in __del__
  File "C:\Users\aaron\AppData\Local\Programs\Python\Python39\lib\site-packages\instrumental\drivers\spectrometers\thorlabs_ccs.py", line 190, in close  
  File "C:\Users\aaron\AppData\Local\Programs\Python\Python39\lib\site-packages\nicelib\nicelib.py", line 1140, in __get__
  File "C:\Users\aaron\AppData\Local\Programs\Python\Python39\lib\site-packages\nicelib\nicelib.py", line 689, in __init__
  File "C:\Users\aaron\AppData\Local\Programs\Python\Python39\lib\site-packages\nicelib\nicelib.py", line 692, in _assign_signature
ImportError: sys.meta_path is None, Python is likely shutting down

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants