Spyder: Run cell (ctrl+Enter) don't work in Spyder inatalled with the Anaconda

Created on 21 Mar 2019  Â·  24Comments  Â·  Source: spyder-ide/spyder

Issue Report Checklist

  • Searched the issues page for similar reports
    *Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)

    • Restarted Spyder

    • Reset preferences with spyder --reset

    • Reinstalled the latest version of Anaconda

    • Tried the other applicable steps from the Troubleshooting Guide

  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

Executing the "run cell" (ctrl + enter) on code in the Spyder editor produces no response/output in the console. The same with the "print" command appearing in the code - no output displayed in the console.

What steps reproduce the problem?

  1. Using the "ctrl + enter" command on relevant code in the editor.
  2. print() seems not to work.
  3. Only when copying the code from 1 and 2 into the console command prompt I get the relevant results.

What is the expected output? What do you see instead?

Nothing is produced

Paste Traceback/Error Below (if applicable)

PASTE TRACEBACK HERE

Versions

  • Spyder version: 3.3.2
  • Python version: 3.7
  • Qt version: 5.9.7
  • PyQt version: 5.9.2
  • Operating System name/version:
    win 10 pro

    Dependencies

PASTE DEPENDENCIES HERE
Awaiting Followup

Most helpful comment

2020-03-20_234934

I got the same issue but resolved it using F9. instead of using "ctrl+enter" use 'F9' to execute a single line or a block of code.

ddd

All 24 comments

Did you create a cell with a comment of the form #%% before pressing Ctrl+Enter?

Closing due to lack of response.

Did you create a cell with a comment of the form #%% before pressing Ctrl+Enter?

This didn't use to be a requirement, right? Is this the only way to run individual lines now?

No, individual lines are run with F9.

Lol. Yeah, sorry. Got rusty and forgot about it.

In the event you are still reading this thread. The Spyder 4.0 IDE is fantastic, thank you. If you could someday let users switch the F9 functionality to running cells and control-Enter to execute a line or selection, that would be great. I am automatically used to testing lines with control-Enter and the #%% is just not as convenient or visually inviting with the Spyder Dark Theme.

Thank you again for a great product.

Currently the only way to do it with Spyder 4.0 is to place #%% before
and after the line or lines you wish to execute. Then just press
control - enter by having your cursor inside the designated section
(between the 2 #%%).

------ Original Message ------
From: "Leonard D. Vorbeck" notifications@github.com
To: "spyder-ide/spyder" spyder@noreply.github.com
Cc: "Yiorgos" ynikas@yahoo.com; "Mention" mention@noreply.github.com
Sent: 12/11/2019 2:34:08 PM
Subject: Re: [spyder-ide/spyder] Run cell (ctrl+Enter) don't work in
Spyder inatalled with the Anaconda (#8994)

@yiorgosn https://github.com/yiorgosn How can i used ctrl+enter to
run certain lines in spyder4? It gets somehow converted into a
"runcell" command, which does not work...

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/spyder-ide/spyder/issues/8994?email_source=notifications&email_token=AG34HO36C2O6FODPRADWBKLQYDM4BA5CNFSM4HAEGOM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGS6KEY#issuecomment-564520211,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AG34HO7F626DCPKL3IUPQ4LQYDM4BANCNFSM4HAEGOMQ.

@yiorgosn, if swapping F9 and Ctri+Enter default behaviors is not working for you, that's a bug that we need to fix. Please open a new issue about it so we don't forget to take a look at it in the future.

@yiorgosn You can just change the shortcuts in the settings !! Spyder 4 ftw

I am just new here and made a rookie mistake, sorry for the trouble, it
was but a simple fix.

Tools -> Preferences - Keyboard Shortcuts

Thanks again! I absolutely love Spyder 4.0!

------ Original Message ------
From: "Leonard D. Vorbeck" notifications@github.com
To: "spyder-ide/spyder" spyder@noreply.github.com
Cc: "Yiorgos" ynikas@yahoo.com; "Mention" mention@noreply.github.com
Sent: 12/11/2019 4:35:52 PM
Subject: Re: [spyder-ide/spyder] Run cell (ctrl+Enter) don't work in
Spyder inatalled with the Anaconda (#8994)

@yiorgosn https://github.com/yiorgosn You can just change the
shortcuts in the settings !! Spyder 4 ftw

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/spyder-ide/spyder/issues/8994?email_source=notifications&email_token=AG34HO7U5RZKC7Z2HIQBLTDQYD3ERA5CNFSM4HAEGOM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGTK7ZY#issuecomment-564572135,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AG34HO7OTBAN6NU7B52P3J3QYD3ERANCNFSM4HAEGOMQ.

Hi I just came across this as I was having difficulty running a cell block. I am able to run a cell block using #%% before and after, not sure why we have to do this, but at least it works. But now it won't let me run a block of code without indenting everything backwards! Is this going to be fixed in the future? Otherwise I might have to back to spyder3. Thanks

finally i found a solution, what a headache it was
i stopped using spyder because i thought it got corrupted

I do not see how this is fixed. Changing the shortcut in settings doesn't change the behavior. I still cannot highlight rows and run that cell. How can that behavior be brought back?

2020-03-20_234934

I got the same issue but resolved it using F9. instead of using "ctrl+enter" use 'F9' to execute a single line or a block of code.

ddd

Any update on this? Can't queue cells or blocks of code

Can't queue cells or blocks of code

That functionality was removed a couple of years ago and it'll come back in Spyder 4.2 or 5, we're still thinking about it.

I am using F9 for this function. it's working well

In Spyder 3.7, Select the desired lines of Code -> -> press (Fn + F9) which works just like (Ctrl + Enter) in Spyder 3.6.

I'm experiencing an issue in Spyder 4, freshly installed, that Ctrl+Enter starts to execute the whole script (e.g. liek F5), and not the cell.
I have checked keyboard shortcuts and have cells split by #%%
Anyone else get this?

Hi @byersiiasa could you provide a GIF to understands the behavior you're experiencing (or maybe a reproducible example)? I tested on Windows and the shortcut seems like it's working:

cells

If you keep experiencing an issue maybe it could be worthy to open a new issue where you add more info about your setup (i.e OS, specific version, etc.) and the GIF or steps to reproduce the issue you're facing :)

thanks @dalthviz will try a MWE
whats the cool gif app you used that shows the keys?

Awesome @byersiiasa :) About the apps: to record the GIF I used LICECap and to show the keystrokes I used Carnac

sorry to say - that I did a classic "power cycle" - and my issue disappeared... thanks though!

No problem @byersiiasa glad you figure it out!

Was this page helpful?
0 / 5 - 0 ratings