Skip to content

Instantly share code, notes, and snippets.

@bruceravel
Created August 14, 2024 13:23
Show Gist options
  • Select an option

  • Save bruceravel/9abe241af30fb5c6a7a41592b0415297 to your computer and use it in GitHub Desktop.

Select an option

Save bruceravel/9abe241af30fb5c6a7a41592b0415297 to your computer and use it in GitHub Desktop.
[TerminalIPythonApp] WARNING | Unknown error in handling startup files:
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
File /nsls2/conda/envs/2024-2.3-py310-tiled/lib/python3.10/site-packages/IPython/core/shellapp.py:359, in InteractiveShellApp._exec_file(self, fname, shell_futures)
355 self.shell.safe_execfile_ipy(full_filename,
356 shell_futures=shell_futures)
357 else:
358 # default to python, even without extension
--> 359 self.shell.safe_execfile(full_filename,
360 self.shell.user_ns,
361 shell_futures=shell_futures,
362 raise_exceptions=True)
363 finally:
364 sys.argv = save_argv
File /nsls2/conda/envs/2024-2.3-py310-tiled/lib/python3.10/site-packages/IPython/core/interactiveshell.py:2932, in InteractiveShell.safe_execfile(self, fname, exit_ignore, raise_exceptions, shell_futures, *where)
2930 try:
2931 glob, loc = (where + (None, ))[:2]
-> 2932 py3compat.execfile(
2933 fname, glob, loc,
2934 self.compile if shell_futures else None)
2935 except SystemExit as status:
2936 # If the call was made with 0 or None exit status (sys.exit(0)
2937 # or sys.exit() ), don't bother showing a traceback, as both of
(...)
2943 # For other exit status, we show the exception unless
2944 # explicitly silenced, but only in short form.
2945 if status.code:
File /nsls2/conda/envs/2024-2.3-py310-tiled/lib/python3.10/site-packages/IPython/utils/py3compat.py:55, in execfile(fname, glob, loc, compiler)
53 with open(fname, "rb") as f:
54 compiler = compiler or compile
---> 55 exec(compiler(f.read(), fname, "exec"), glob, loc)
File /nsls2/data3/bmm/shared/config/bluesky/profile_collection/startup/00-populate-namespace.py:1
----> 1 from BMM.user_ns import *
6 # def handler(signum, frame):
7 # #print(f'Handling signal {signum} ({signal.Signals(signum).name}).')
8 # text = termcolor.colored('''
(...)
27
28 # signal.signal(signal.SIGTSTP, handler)
File /nsls2/data3/bmm/shared/config/bluesky/profile_collection/startup/BMM/user_ns/__init__.py:14
11 from bluesky.plan_stubs import mv, mvr
13 # basic Bluesky/Ophyd/Databroker functionality, deal with QS vs. bsui
---> 14 from .base import *
16 # define/initialize BMMuser, define ROI object
17 from .bmm import *
File /nsls2/data3/bmm/shared/config/bluesky/profile_collection/startup/BMM/user_ns/base.py:31
29 if not is_re_worker_active():
30 ip = get_ipython()
---> 31 nslsii.configure_base(ip.user_ns, 'bmm', configure_logging=True, publish_documents_with_kafka=use_kafka)
32 ip.log.setLevel('ERROR')
33 RE = ip.user_ns['RE']
File /nsls2/conda/envs/2024-2.3-py310-tiled/lib/python3.10/site-packages/nslsii/__init__.py:135, in configure_base(user_ns, broker_name, bec, bec_derivative, call_returns_result, epics_context, magics, mpl, configure_logging, pbar, ipython_logging, publish_documents_with_kafka, tb_minimize)
133 directory = os.path.expanduser("~/.config/bluesky/md")
134 os.makedirs(directory, exist_ok=True)
--> 135 md = PersistentDict(directory)
136 else:
137 # legacy approach using HistoryDict
138 from bluesky.utils import get_history
File /nsls2/conda/envs/2024-2.3-py310-tiled/lib/python3.10/site-packages/bluesky/utils/__init__.py:811, in PersistentDict.__init__(self, directory)
809 self._func = zict.Func(self._dump, self._load, self._file)
810 self._cache = {}
--> 811 self.reload()
813 # Similar to flush() or _do_update(), but without reference to self
814 # to avoid circular reference preventing collection.
815 # NOTE: This still doesn't guarantee call on delete or gc.collect()!
816 # Explicitly call flush() if immediate write to disk required.
817 def finalize(zfile, cache, dump):
File /nsls2/conda/envs/2024-2.3-py310-tiled/lib/python3.10/site-packages/bluesky/utils/__init__.py:871, in PersistentDict.reload(self)
869 def reload(self):
870 """Force a reload from disk, overwriting current cache"""
--> 871 self._cache = dict(self._func.items())
File /nsls2/conda/envs/2024-2.3-py310-tiled/lib/python3.10/site-packages/zict/func.py:74, in <genexpr>(.0)
73 def items(self) -> Iterator[tuple[KT, VT]]: # type: ignore
---> 74 return ((k, self.load(v)) for k, v in self.d.items())
File /nsls2/conda/envs/2024-2.3-py310-tiled/lib/python3.10/_collections_abc.py:911, in ItemsView.__iter__(self)
909 def __iter__(self):
910 for key in self._mapping:
--> 911 yield (key, self._mapping[key])
File /nsls2/conda/envs/2024-2.3-py310-tiled/lib/python3.10/site-packages/zict/file.py:82, in File.__getitem__(self, key)
80 raise KeyError(key)
81 fn = os.path.join(self.directory, _safe_key(key))
---> 82 with open(fn, "rb") as fh:
83 if self.memmap:
84 return memoryview(mmap.mmap(fh.fileno(), 0, access=mmap.ACCESS_READ))
FileNotFoundError: [Errno 2] No such file or directory: '/home/xf06bm/.config/bluesky/md/scan_id%233'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment