JonghoKim
JonghoKim

Reputation: 1995

A very basic setting issue about spyder and anaconda for python

I am a beginner of spyder IDE for Python.

To use spyder IDE, I command "spyder" on anaconda console with python 2.7

After that, I try to print "hi"

But I encounter an error message

"No python shell is currently selected to run hu.py Please select or open a new Python interpreter and try again"

How could I solve this problem?

I saved my file on C:\Anaconda\practice_jhk

from __future__ import print_function
print ("hi")

Upvotes: 9

Views: 65537

Answers (7)

lahiru lowe
lahiru lowe

Reputation: 1

Go to Consoles > New console(default settings)

Upvotes: 0

Karri Saipranav
Karri Saipranav

Reputation: 1

You might have unexpectedly closed the Ipython console window which is open by default and that caused the error.

Upvotes: 0

Danny Zilberg
Danny Zilberg

Reputation: 11

I had this issue when I didn't have the python console pane open. To resolve this, in the top bar go to: view -> panes and turn ipython console on.

This fixed it for me.

Upvotes: 0

Shirantha Madusanka
Shirantha Madusanka

Reputation: 1695

Try, tools -> Reset sypder to factory default. Then, click on the run button in the dialog box.

Upvotes: 1

user3369577
user3369577

Reputation: 11

I was getting the same error message, but then realized I was not directing the PATH to my Python interpreter file at all. How I solved the problem:

Go to Tools > PYTHONPATH manager
Select "Add path"
Find and select your Python interpreter folder (for me this was C:\Python27)

Upvotes: 1

Akash Kumar singh
Akash Kumar singh

Reputation: 49

I have had the same problem. I am not able to fix it but I am able to successfully run the program the following two ways and I don't find any problems till now:

  1. By selecting IPython console (not the one with the Kernel id as its tab) then running your program.
  2. By selecting "Execute in new dedicated Python console" from Tools --> Preferences --> Run.

Upvotes: 1

wombatonfire
wombatonfire

Reputation: 5440

You can specify the Spyder's Run Settings in Run -> Configure (F6). By default "Execute in current Python or IPython console" is selected and you probably do not have any open console in Spyder.

You can select "Execute in a new dedicated Python console" option and Spyder will automatically open a new console for you. Or you can leave the dafault option and create a new console yourself in the Consoles menu.

Upvotes: 9

Related Questions