You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the same issue when I compile a shot after changing a connection table, and the only solution is to restart runmanager:
Z:\K_ML\userlib\labscriptlib\K_ML\connection_table.py modified: all non-whitelisted modules will be reloaded next run.
Traceback (most recent call last):
File "Z:\K_ML\userlib\labscriptlib\K_ML\Cell_Fluorescence.py", line 6, in
import_or_reload('labscriptlib.K_ML.connection_table')
File "c:\users\rubidium\anaconda3\lib\site-packages\labscript_utils_init_.py", line 46, in import_or_reload
module = importlib.import_module(modulename)
File "c:\users\rubidium\anaconda3\lib\importlib_init_.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 971, in _find_and_load_unlocked
File "", line 914, in _find_spec
File "c:\users\rubidium\anaconda3\lib\site-packages\labscript_utils\double_import_denier.py", line 52, in find_spec
dict_key = (fullname, tuple(path) if path is not None else None)
File "", line 1174, in iter
File "", line 1162, in _recalculate
File "", line 1158, in _get_parent_path
KeyError: 'labscriptlib'
Compilation aborted.
I'm pretty late to the party here, but I've seen a similar bug before. I resolved it by adding empty __init__.py files to the directories in userlib wherever modules were imported from. Those files aren't in general needed for Python 3 but I've seen that some of the import machinery that labscript uses can break without them. I'm not sure that adding those files would resolve this issue as well, but it might be worth a try. If that does work, it may be worth opening another feature request issue to make the import stuff work without __init__.py files.
Original report (archived issue) by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).
Labscript compilation using
import_or_reload
can crash with the following after a module has been modified:Saw this on a fresh install with Python 3.7 in miniconda, and the latest released versions of everything as of a week ago.
The text was updated successfully, but these errors were encountered: