Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Please help me get blacs running again

62 views
Skip to first unread message

Kayla Jane Rodriguez

unread,
Feb 5, 2025, 12:33:54 PMFeb 5
to the labscript suite
Hi everyone! I have been trying to run blacs. In trying to debug in making a custom device and mistakenly ran "update blacs" and it messed up everything. I have tried uninstalling and reinstalling completely both with conda and python virtual env. I am getting generic python errors that people have gotten separate from labscript. I tried downgrading my python from 3.11 to 3.10. I keep getting a device registry issue


Traceback (most recent call last):
  File "C:\Users\schinelab\AppData\Local\Programs\Python\Python310\lib\threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\schinelab\labscript-suite\.venv_3\lib\site-packages\zprocess\utils.py", line 109, in _reraise
    raise value.with_traceback(traceback)
  File "C:\Users\schinelab\labscript-suite\blacs\blacs\__main__.py", line 271, in __init__
    TabClass = device_registry.get_BLACS_tab(labscript_device_class_name)
  File "C:\Users\schinelab\labscript-suite\labscript-utils\labscript_utils\device_registry\_device_registry.py", line 213, in get_BLACS_tab
    return import_class_by_fullname(BLACS_tab_registry[name])
  File "C:\Users\schinelab\labscript-suite\labscript-utils\labscript_utils\device_registry\_device_registry.py", line 174, in import_class_by_fullname
    module = importlib.import_module(module_name)
  File "C:\Users\schinelab\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\Users\schinelab\labscript-suite\labscript-devices\labscript_devices\NI_DAQmx\blacs_tabs.py", line 19, in <module>
    from . import models
  File "C:\Users\schinelab\labscript-suite\labscript-devices\labscript_devices\NI_DAQmx\models\__init__.py", line 31, in <module>
    globals()[class_name] = import_class_by_fullname(path)
  File "C:\Users\schinelab\labscript-suite\labscript-utils\labscript_utils\device_registry\_device_registry.py", line 174, in import_class_by_fullname
    module = importlib.import_module(module_name)
  File "C:\Users\schinelab\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "C:\Users\schinelab\labscript-suite\labscript-devices\labscript_devices\NI_DAQmx\models\NI_PCI_6251.py", line 23, in <module>
    from labscript_devices.NI_DAQmx.labscript_devices import NI_DAQmx
  File "C:\Users\schinelab\labscript-suite\labscript-devices\labscript_devices\NI_DAQmx\labscript_devices.py", line 17, in <module>
    from labscript import (
ImportError: cannot import name 'IntermediateDevice' from 'labscript' (unknown location)

Kayla Jane Rodriguez

unread,
Feb 5, 2025, 5:09:20 PMFeb 5
to the labscript suite
I factory reset the computer and got the same error. However, I find just running it from the terminal (usually more stable) and typing "blacs" in virtual environment throws errors upon startup. I clicked and used the desktop-app version and now it works?

Philip Starkey

unread,
Feb 5, 2025, 5:59:58 PMFeb 5
to the labscript suite
Hi Kayla,

That error from BLACS suggests that it can't find the labscript Python library. This is a bit confusing since it can find labscript_devices, but it suggests that there is probably an issue with your labscript suite install or Python virtual environment. Given that the shortcut you found works, my bet would be that the terminal you were launching BLACS from is not using the correct Python virtual environment. You may even have multiple copies of labscript suite libraries installed, which could result in accidentally launching the incorrect one.

Are you using Anaconda Python?
Which install method for the labscript suite was originally used?
You may also be able to get some hints from what is going on by looking at the properties of the shortcut that works. Some of the paths inside the shortcut file properties should tell you information about the copy of BLACS that is working and the Python virtual environment it is running in.

Cheers,
Phil 

Kayla Jane Rodriguez

unread,
Feb 5, 2025, 7:52:09 PMFeb 5
to labscri...@googlegroups.com
I factory reset the computer and did only one virtual env setup and ran it inside. I’ve been able to recreate the issue on several windows machines 
--
You received this message because you are subscribed to a topic in the Google Groups "the labscript suite" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/labscriptsuite/m0GIk_if4ko/unsubscribe.
To unsubscribe from this group and all its topics, send an email to labscriptsuit...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/labscriptsuite/1ba6484c-28ed-4f93-8657-166c2338aea5n%40googlegroups.com.

dihm....@gmail.com

unread,
Feb 11, 2025, 12:11:16 PMFeb 11
to the labscript suite
Kayla,

I agree with Phil, this is very perplexing. You might try opening a python interpreter and trying to import each component, one at a time, to try and figure out what works and what doesn't. For those that work, try printing `module.__file__` to see where the file is actually importing from to ensure it is coming from where you expect it to.

If that doesn't help, let me know and I can try to swing by your lab.

-David

dihm....@gmail.com

unread,
Feb 18, 2025, 3:13:31 PMFeb 18
to the labscript suite
Kayla,

I just encountered a very similar error on a system here. They may be the same issue. I was able to resolve it by deleting the app saved config for BLACS (contents of labscript-suite/app_saved_configs/<apparatus_name>/blacs). The issue I encountered likely involves PR#107 of blacs which touched on handling borked app saved config files. If that fixes things for you, let me know and I'll dig in more on what that change is doing.

-David

Kayla Jane Rodriguez

unread,
Mar 5, 2025, 2:31:44 PMMar 5
to the labscript suite
Thanks all for the advice! Sorry for the delay in response. I will try that/keep this in mind if happens again. Currently, BLACS and labscript works by going through the desktop app. I wanted to run it through the terminal to see the error messages as BLACs pops up but it just doesnt work, but is currently working on our lab computer by going through the desktop-app 
Reply all
Reply to author
Forward
0 new messages