-
Notifications
You must be signed in to change notification settings - Fork 0
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
Crashed BlueSky #7
Comments
When I tried to continue with command line, it seemed unresponsive and when I hit enter, it opened GUI with DataBroker catalog, when I tried to close it it stated it was not saved. Closed anyway, but looks like DataBroker was active and waiting for something. |
Problem here is that matplotlib is being configured with Tk. That's the
problem to be fixed.
…On Fri, Oct 25, 2024, 9:25 AM Jan Ilavsky ***@***.***> wrote:
When I tried to continue with command line, it seemed unresponsive and
when I hit enter, it opened GUI with DataBroker catalog, when I tried to
close it it stated it was not saved. Closed anyway, but looks like
DataBroker was active and waiting for something.
—
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AARMUMHECEUYBP6MTMHNJYTZ5JIEZAVCNFSM6AAAAABQTMWIAGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMZXHE3DANRTHE>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
Matplotlib seems to be imported in generic configuration of bluesky, for notebook as well as console session. |
This thread from Bluesky's Mattermost discussion: The supported backends (at this time) are: I'm thinking that the conda environment did not get a requirement to install one of the Qt packages. If this is left to |
Related to: prjemian/model_instrument#5 |
Short version : recreating bluesky_2024_3 from yml file does not help. |
I'm reinstalling from https://raw.githubusercontent.com/BCDA-APS/bluesky_training/refs/heads/main/bluesky/environments/environment_2024_3.yml (downloading into |
With re-installed environment, restarted session. This is the test: In [1]: import matplotlib as mpl
In [2]: mpl.backends.backend
Out[2]: 'tkagg' Should be |
Similar to prjemian/model_instrument#5, but not the same startup code. |
Similar versions with that issue's solved version: In [3]: !conda list qt
/share1/bluesky/conda_envs/bluesky_2024_3/lib/python3.11/site-packages/IPython/core/interactiveshell.py:2673: UserWarning: You executed the system command !conda which may not work as expected. Try the IPython magic %conda instead.
warnings.warn(
# packages in environment at /share1/bluesky/conda_envs/bluesky_2024_3:
#
# Name Version Build Channel
pyqt 5.15.9 py311hf0fb5b6_5 conda-forge
pyqt5-sip 12.12.2 py311hb755f60_5 conda-forge
pyqtgraph 0.12.4 pypi_0 pypi
qt 5.15.8 hf11cfaa_0 conda-forge
qt-main 5.15.8 h374914d_26 conda-forge
qt-webengine 5.15.8 h8f589be_8 conda-forge
qtconsole 5.6.0 pypi_0 pypi
qtpy 2.4.1 pypi_0 pypi
sphinxcontrib-qthelp 2.0.0 pypi_0 pypi |
At this point: bluesky/instrument/mpl/console.py Line 17 in 2e9ba47
The backend is |
Need more diagnostics, increasing the xmode level to (/share1/bluesky/conda_envs/bluesky_2024_3) usaxs@usaxscontrol ~/bluesky $ blueskyStarter.sh
==> CONDA_PREFIX=/share1/bluesky/conda_envs/bluesky_2024_3
/share1/bluesky/conda_envs/bluesky_2024_3/bin/python -- Python 3.11.10
Python 3.11.10 | packaged by conda-forge | (main, Oct 16 2024, 01:27:36) [GCC 13.3.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.29.0 -- An enhanced Interactive Python. Type '?' for help.
IPython profile: bluesky
Exception reporting mode: Minimal
/home/beams11/USAXS/bluesky/instrument/_iconfig.py
Activating auto-logging. Current session state plus future input saved.
Filename : /home/beams11/USAXS/bluesky/.logs/ipython_console.log
Mode : rotate
Output logging : True
Raw input log : False
Timestamping : True
State : active
I Sun-17:24:43 - ############################################################ startup
I Sun-17:24:43 - logging started
I Sun-17:24:43 - logging level = 10
I Sun-17:24:43 - /home/beams11/USAXS/bluesky/instrument/session_logs.py
I Sun-17:24:43 - /home/beams11/USAXS/bluesky/instrument/collection.py
I Sun-17:24:43 - CONDA_PREFIX = /share1/bluesky/conda_envs/bluesky_2024_3
Exception reporting mode: Verbose
I Sun-17:24:43 - xmode exception level: 'Verbose'
I Sun-17:24:43 - /home/beams11/USAXS/bluesky/instrument/mpl/console.py
PyQt5.__file__='/share1/bluesky/conda_envs/bluesky_2024_3/lib/python3.11/site-packages/PyQt5/__init__.py'
matplotlib.backends.backend='tkagg'
[TerminalIPythonApp] WARNING | Unknown error in handling startup files:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
File /share1/bluesky/conda_envs/bluesky_2024_3/lib/python3.11/site-packages/IPython/core/shellapp.py:403, in InteractiveShellApp._exec_file(self=<IPython.terminal.ipapp.TerminalIPythonApp object>, fname='/home/beams/USAXS/.ipython-bluesky/profile_bluesky/startup/__start_instrument__.py', shell_futures=False)
399 self.shell.safe_execfile_ipy(full_filename,
400 shell_futures=shell_futures)
401 else:
402 # default to python, even without extension
--> 403 self.shell.safe_execfile(full_filename,
full_filename = '/home/beams/USAXS/.ipython-bluesky/profile_bluesky/startup/__start_instrument__.py'
self = <IPython.terminal.ipapp.TerminalIPythonApp object at 0x7f7bf35a6990>
shell_futures = False
404 self.shell.user_ns,
405 shell_futures=shell_futures,
406 raise_exceptions=True)
407 finally:
408 sys.argv = save_argv
File /share1/bluesky/conda_envs/bluesky_2024_3/lib/python3.11/site-packages/IPython/core/interactiveshell.py:2932, in InteractiveShell.safe_execfile(self=<IPython.terminal.interactiveshell.TerminalInteractiveShell object>, fname=PosixPath('/home/beams11/USAXS/.ipython-bluesky/profile_bluesky/startup/__start_instrument__.py'), exit_ignore=False, raise_exceptions=True, shell_futures=False, *where=({'In': [''], 'Out': {}, '_': '', '__': '', '___': '', '__builtin__': <module 'builtins' (built-in)>, '__builtins__': <module 'builtins' (built-in)>, '__doc__': '\nstart bluesky in IPython session\n', '__loader__': None, '__name__': '__main__', ...},))
2930 try:
2931 glob, loc = (where + (None, ))[:2]
-> 2932 py3compat.execfile(
py3compat = <module 'IPython.utils.py3compat' from '/share1/bluesky/conda_envs/bluesky_2024_3/lib/python3.11/site-packages/IPython/utils/py3compat.py'>
fname = PosixPath('/home/beams11/USAXS/.ipython-bluesky/profile_bluesky/startup/__start_instrument__.py')
glob = {'__name__': '__main__', '__doc__': '\nstart bluesky in IPython session\n', '__package__': None, '__loader__': None, '__spec__': None, '__builtin__': <module 'builtins' (built-in)>, '__builtins__': <module 'builtins' (built-in)>, '_ih': [''], '_oh': {}, '_dh': [PosixPath('/home/beams11/USAXS/bluesky')], 'In': [''], 'Out': {}, 'get_ipython': <bound method InteractiveShell.get_ipython of <IPython.terminal.interactiveshell.TerminalInteractiveShell object at 0x7f7bf125af10>>, 'exit': <IPython.core.autocall.ExitAutocall object at 0x7f7bf1143dd0>, 'quit': <IPython.core.autocall.ExitAutocall object at 0x7f7bf1143dd0>, 'open': <function open at 0x7f7bf1b85260>, '_': '', '__': '', '___': '', 'faulthandler': <module 'faulthandler' (built-in)>, 'pathlib': <module 'pathlib' from '/share1/bluesky/conda_envs/bluesky_2024_3/lib/python3.11/pathlib.py'>, 'sys': <module 'sys' (built-in)>, 'path': PosixPath('/home/beams/USAXS/bluesky')}
loc = None
self = <IPython.terminal.interactiveshell.TerminalInteractiveShell object at 0x7f7bf125af10>
shell_futures = False
self.compile = <IPython.core.compilerop.CachingCompiler object at 0x7f7bf1335e90>
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 /share1/bluesky/conda_envs/bluesky_2024_3/lib/python3.11/site-packages/IPython/utils/py3compat.py:55, in execfile(fname=PosixPath('/home/beams11/USAXS/.ipython-bluesky/profile_bluesky/startup/__start_instrument__.py'), glob={'In': [''], 'Out': {}, '_': '', '__': '', '___': '', '__builtin__': <module 'builtins' (built-in)>, '__builtins__': <module 'builtins' (built-in)>, '__doc__': '\nstart bluesky in IPython session\n', '__loader__': None, '__name__': '__main__', ...}, loc={'In': [''], 'Out': {}, '_': '', '__': '', '___': '', '__builtin__': <module 'builtins' (built-in)>, '__builtins__': <module 'builtins' (built-in)>, '__doc__': '\nstart bluesky in IPython session\n', '__loader__': None, '__name__': '__main__', ...}, compiler=<built-in function compile>)
53 with open(fname, "rb") as f:
54 compiler = compiler or compile
---> 55 exec(compiler(f.read(), fname, "exec"), glob, loc)
loc = {'__name__': '__main__', '__doc__': '\nstart bluesky in IPython session\n', '__package__': None, '__loader__': None, '__spec__': None, '__builtin__': <module 'builtins' (built-in)>, '__builtins__': <module 'builtins' (built-in)>, '_ih': [''], '_oh': {}, '_dh': [PosixPath('/home/beams11/USAXS/bluesky')], 'In': [''], 'Out': {}, 'get_ipython': <bound method InteractiveShell.get_ipython of <IPython.terminal.interactiveshell.TerminalInteractiveShell object at 0x7f7bf125af10>>, 'exit': <IPython.core.autocall.ExitAutocall object at 0x7f7bf1143dd0>, 'quit': <IPython.core.autocall.ExitAutocall object at 0x7f7bf1143dd0>, 'open': <function open at 0x7f7bf1b85260>, '_': '', '__': '', '___': '', 'faulthandler': <module 'faulthandler' (built-in)>, 'pathlib': <module 'pathlib' from '/share1/bluesky/conda_envs/bluesky_2024_3/lib/python3.11/pathlib.py'>, 'sys': <module 'sys' (built-in)>, 'path': PosixPath('/home/beams/USAXS/bluesky')}
glob = {'__name__': '__main__', '__doc__': '\nstart bluesky in IPython session\n', '__package__': None, '__loader__': None, '__spec__': None, '__builtin__': <module 'builtins' (built-in)>, '__builtins__': <module 'builtins' (built-in)>, '_ih': [''], '_oh': {}, '_dh': [PosixPath('/home/beams11/USAXS/bluesky')], 'In': [''], 'Out': {}, 'get_ipython': <bound method InteractiveShell.get_ipython of <IPython.terminal.interactiveshell.TerminalInteractiveShell object at 0x7f7bf125af10>>, 'exit': <IPython.core.autocall.ExitAutocall object at 0x7f7bf1143dd0>, 'quit': <IPython.core.autocall.ExitAutocall object at 0x7f7bf1143dd0>, 'open': <function open at 0x7f7bf1b85260>, '_': '', '__': '', '___': '', 'faulthandler': <module 'faulthandler' (built-in)>, 'pathlib': <module 'pathlib' from '/share1/bluesky/conda_envs/bluesky_2024_3/lib/python3.11/pathlib.py'>, 'sys': <module 'sys' (built-in)>, 'path': PosixPath('/home/beams/USAXS/bluesky')}
f = <_io.BufferedReader name='/home/beams11/USAXS/.ipython-bluesky/profile_bluesky/startup/__start_instrument__.py'>
compiler = <built-in function compile>
fname = PosixPath('/home/beams11/USAXS/.ipython-bluesky/profile_bluesky/startup/__start_instrument__.py')
File /home/beams11/USAXS/.ipython-bluesky/profile_bluesky/startup/__start_instrument__.py:21
18 # terse error dumps
19 get_ipython().run_line_magic('xmode', 'Minimal')
---> 21 from instrument.collection import *
File /home/beams11/USAXS/bluesky/instrument/collection.py:27
24 logger.info("xmode exception level: '%s'", _xmode_level)
25 del _ip
---> 27 from . import mpl
29 logger.info("#### Bluesky Framework ####")
30 from .framework import *
File /home/beams11/USAXS/bluesky/instrument/mpl/__init__.py:31
29 from .notebook import *
30 else:
---> 31 from .console import *
File /home/beams11/USAXS/bluesky/instrument/mpl/console.py:23
20 plt.ion()
22 print(f"{matplotlib.backends.backend=!r}")
---> 23 matplotlib.use("qtAgg")
24 if matplotlib.backends.backend not in ("qtagg"):
25 raise RuntimeError(
26 f"Wrong MatPlotLib backend: {matplotlib.backends.backend=!r}"
27 )
File /share1/bluesky/conda_envs/bluesky_2024_3/lib/python3.11/site-packages/matplotlib/__init__.py:1255, in use(backend='qtAgg', force=True)
1250 if plt is not None:
1251 try:
1252 # we need this import check here to re-raise if the
1253 # user does not have the libraries to support their
1254 # chosen backend installed.
-> 1255 plt.switch_backend(name)
name = 'qtAgg'
plt = <module 'matplotlib.pyplot' from '/share1/bluesky/conda_envs/bluesky_2024_3/lib/python3.11/site-packages/matplotlib/pyplot.py'>
1256 except ImportError:
1257 if force:
File /share1/bluesky/conda_envs/bluesky_2024_3/lib/python3.11/site-packages/matplotlib/pyplot.py:415, in switch_backend(newbackend='qtAgg')
412 # have to escape the switch on access logic
413 old_backend = dict.__getitem__(rcParams, 'backend')
--> 415 module = backend_registry.load_backend_module(newbackend)
newbackend = 'qtAgg'
backend_registry = <matplotlib.backends.registry.BackendRegistry object at 0x7f7b79a918d0>
416 canvas_class = module.FigureCanvas
418 required_framework = canvas_class.required_interactive_framework
File /share1/bluesky/conda_envs/bluesky_2024_3/lib/python3.11/site-packages/matplotlib/backends/registry.py:323, in BackendRegistry.load_backend_module(self=<matplotlib.backends.registry.BackendRegistry object>, backend='qtAgg')
309 """
310 Load and return the module containing the specified backend.
311
(...)
320 Module containing backend.
321 """
322 module_name = self._backend_module_name(backend)
--> 323 return importlib.import_module(module_name)
module_name = 'matplotlib.backends.backend_qtagg'
File /share1/bluesky/conda_envs/bluesky_2024_3/lib/python3.11/importlib/__init__.py:126, in import_module(name='matplotlib.backends.backend_qtagg', package=None)
124 break
125 level += 1
--> 126 return _bootstrap._gcd_import(name[level:], package, level)
level = 0
name = 'matplotlib.backends.backend_qtagg'
name[level:] = 'matplotlib.backends.backend_qtagg'
package = None
_bootstrap = <module '_frozen_importlib' (frozen)>
File /share1/bluesky/conda_envs/bluesky_2024_3/lib/python3.11/site-packages/matplotlib/backends/backend_qtagg.py:9
5 import ctypes
7 from matplotlib.transforms import Bbox
----> 9 from .qt_compat import QT_API, QtCore, QtGui
10 from .backend_agg import FigureCanvasAgg
11 from .backend_qt import _BackendQT, FigureCanvasQT
File /share1/bluesky/conda_envs/bluesky_2024_3/lib/python3.11/site-packages/matplotlib/backends/qt_compat.py:130
128 break
129 else:
--> 130 raise ImportError(
QT_API = 'PySide2'
_candidates = [(<function _setup_pyqt5plus at 0x7f7b66dcd3a0>, 'PyQt6'), (<function _setup_pyqt5plus at 0x7f7b66dcd3a0>, 'PySide6'), (<function _setup_pyqt5plus at 0x7f7b66dcd3a0>, 'PyQt5'), (<function _setup_pyqt5plus at 0x7f7b66dcd3a0>, 'PySide2')]
131 "Failed to import any of the following Qt binding modules: {}"
132 .format(", ".join([QT_API for _, QT_API in _candidates]))
133 )
134 else: # We should not get there.
135 raise AssertionError(f"Unexpected QT_API: {QT_API}")
ImportError: Failed to import any of the following Qt binding modules: PyQt6, PySide6, PyQt5, PySide2 |
A clue comes from another discussion. Testing with this console command: In [3]: %gui qt
ERROR:root:/lib64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /share1/bluesky/conda_envs/bluesky_2024_3/lib/python3.11/site-packages/PyQt5/../../../libQt5Core.so.5) Is the library file |
That library is already installed under (/share1/bluesky/conda_envs/bluesky_2024_3) usaxs@usaxscontrol ~/bluesky $ strings $CONDA_PREFIX/lib/libstdc++.so | grep GLIBCXX | grep 26
GLIBCXX_3.4.26
_ZNSbIwSt11char_traitsIwESaIwEE4_Rep26_M_set_length_and_sharableEm@@GLIBCXX_3.4.5
_ZNSs4_Rep26_M_set_length_and_sharableEm@GLIBCXX_3.4
_ZNSbIwSt11char_traitsIwESaIwEE4_Rep26_M_set_length_and_sharableEm@GLIBCXX_3.4
_ZNSs4_Rep26_M_set_length_and_sharableEm@@GLIBCXX_3.4.5
GLIBCXX_3.4.26 Solution to this problemDefine in bash shell: |
Test proper operation using simulator: Start console session as usual: Load ophyd simulator and scan it: In [1]: from ophyd.sim import noisy_det, motor
In [2]: RE(bp.scan([noisy_det], motor, -3, 3, 31))
Transient Scan ID: 14 Time: 2024-10-27 18:21:44
Persistent Unique Scan ID: '3236f8b2-93d1-4d55-8f89-f91f29b55b02'
New stream: 'baseline'
New stream: 'primary'
+-----------+------------+------------+------------+
| seq_num | time | motor | noisy_det |
+-----------+------------+------------+------------+
| 1 | 18:21:44.3 | -3.000 | 0.009 |
| 2 | 18:21:45.3 | -2.800 | 0.022 |
| 3 | 18:21:45.3 | -2.600 | 0.085 |
| 4 | 18:21:45.3 | -2.400 | 0.105 |
| 5 | 18:21:45.3 | -2.200 | 0.149 |
| 6 | 18:21:45.3 | -2.000 | 0.186 |
| 7 | 18:21:45.3 | -1.800 | 0.267 |
| 8 | 18:21:45.3 | -1.600 | 0.335 |
| 9 | 18:21:45.3 | -1.400 | 0.410 |
| 10 | 18:21:45.3 | -1.200 | 0.405 |
| 11 | 18:21:45.3 | -1.000 | 0.629 |
| 12 | 18:21:45.3 | -0.800 | 0.704 |
| 13 | 18:21:45.4 | -0.600 | 0.867 |
| 14 | 18:21:45.4 | -0.400 | 0.843 |
| 15 | 18:21:45.4 | -0.200 | 0.983 |
| 16 | 18:21:45.4 | 0.000 | 0.999 |
| 17 | 18:21:45.4 | 0.200 | 0.911 |
| 18 | 18:21:45.4 | 0.400 | 0.958 |
| 19 | 18:21:45.4 | 0.600 | 0.804 |
| 20 | 18:21:45.4 | 0.800 | 0.751 |
| 21 | 18:21:45.4 | 1.000 | 0.663 |
| 22 | 18:21:45.4 | 1.200 | 0.445 |
| 23 | 18:21:45.4 | 1.400 | 0.468 |
| 24 | 18:21:45.4 | 1.600 | 0.374 |
| 25 | 18:21:45.4 | 1.800 | 0.295 |
| 26 | 18:21:45.4 | 2.000 | 0.218 |
| 27 | 18:21:45.5 | 2.200 | 0.042 |
| 28 | 18:21:45.5 | 2.400 | 0.150 |
| 29 | 18:21:45.5 | 2.600 | -0.009 |
| 30 | 18:21:45.5 | 2.800 | 0.074 |
| 31 | 18:21:45.5 | 3.000 | -0.076 |
+-----------+------------+------------+------------+
generator scan ['3236f8b2'] (scan num: 14)
Out[2]: ('3236f8b2-93d1-4d55-8f89-f91f29b55b02',) |
I'll try to explore why this library was not found by default. It should have been found with no additional help. Not obvious why. |
This issue is fixed, scan verified to be working as expected. Thank you! |
Was trying to run scan on monochromator, but it was hanging likely due to tolerance issue. Didctrl-C. 2x and RE.abort. After this run scan on s_stage.x which worked fine, but after that looks like BS crashed:
The text was updated successfully, but these errors were encountered: