Code cells are not being recognized

51 views
Skip to first unread message

AD

unread,
Apr 29, 2020, 3:41:48 PM4/29/20
to spyder
I am a heavy user of code cells, but something has gone strange in Spyder 4.1.x.  I have multiple script files where the editor shows the cell boundaries with lines, but no matter which cell I try to run, it always tries to run cell 0.

When I try to create a new file to demonstrate the problem, of course it works perfectly, and I can't figure out what's throwing Spyder off.  Has anything changed in the cell handling since version 4.0.1?

bcolsen

unread,
Apr 29, 2020, 4:21:30 PM4/29/20
to spyder
What is the input in the console runcell function? Can you check that the code cells names in the outline exporter pane match the runcell input?

bcolsen

unread,
Apr 29, 2020, 4:23:19 PM4/29/20
to spyder
Also if you're running 4.1.x from git you need the latest version of spyder-kernels as well


On Wednesday, April 29, 2020 at 1:41:48 PM UTC-6, AD wrote:

AD

unread,
May 2, 2020, 11:22:11 AM5/2/20
to spyder
Thank you so much for replying.  I posted more details in a stack overflow question since my question was not showing up here.

The behaviour is:
  • the editor shows a red line above each occurence of #%%
  • press Ctrl-Enter in any cell N
  • console shows runcell(0,...
  • the whole file runs as if no cells were defined
Everything is installed using conda

  spyder                                       4.0.1-py37_0 --> 4.1.2-py37_0
  spyder-kernels                               1.8.1-py37_0 --> 1.9.0-py37_0

It's very puzzling on top of being annoying!

Brian Olsen

unread,
May 2, 2020, 9:35:37 PM5/2/20
to spyd...@googlegroups.com
This could be a problem in the actual file line endings. Can you link to a file that has the problem? What operating system?

--
You received this message because you are subscribed to the Google Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spyderlib+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/spyderlib/57015e13-8619-4f6f-90a6-2f088f595de0%40googlegroups.com.

Rational-IM

unread,
May 5, 2020, 6:10:38 PM5/5/20
to spyder
I observed similar behavior when I undocked the Editor window from Spyder. However, if my Editor window is not undocked, running specific cells work fine. Last, the issue doesn't happen every time - i.e., sometimes, with the Editor window undocked, it works OK. I couldn't find a pattern yet. I Will let you know if I do.
Reply all
Reply to author
Forward
0 new messages