Spyder error on return from tuner.fit()

I have noted that following training with Tune, (i.e., tune completes), at the end when
results = tuner.fit()
returns, Spyder becomes unresponsive - I suspect the kernel dies. The error sequence is:

Traceback (most recent call last):

File /var/folders/kl/dl45nqh52334p0q2nd8z4szc0000gn/T/ipykernel_7865/2004984354.py:1
runfile(‘/Users/jamesgriffin/Documents/OneDrive/UTC/Research/RL/MCS/MaskedRaySingleMCS_008.py’, wdir=‘/Users/jamesgriffin/Documents/OneDrive/UTC/Research/RL/MCS’)

File ~/anaconda3/lib/python3.11/site-packages/spyder_kernels/customize/spydercustomize.py:528 in runfile
return _exec_file(

File ~/anaconda3/lib/python3.11/site-packages/spyder_kernels/customize/spydercustomize.py:574 in _exec_file
with NamespaceManager(filename, namespace, current_namespace,

File ~/anaconda3/lib/python3.11/site-packages/spyder_kernels/customize/namespace_manager.py:110 in exit
ipython_shell.kernel._running_namespace = (

AttributeError: ‘NoneType’ object has no attribute ‘kernel’

I’m running ray nightlies, Spyder 5.4.3, Python 3.11 on a Mac M3.

If I run a manual train, the train runs and completes just fine and returns to Spyder, where I can, for example, examine various things from result=algo.train(), or run sequences through algo.compute_single_action(obs) and step through the environment, etc.

This happens for any environment. The Tuner always ends by killing the Spyder/kernel interface. It’s easily fixed be resetting the kernel but then, of course, all data is lost.

Any ideas?