Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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")
like image 987
JonghoKim Avatar asked Jun 25 '14 02:06

JonghoKim


3 Answers

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.

like image 89
wombatonfire Avatar answered Oct 11 '22 21:10

wombatonfire


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.
like image 28
Akash Kumar singh Avatar answered Oct 11 '22 21:10

Akash Kumar singh


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)

like image 22
user3369577 Avatar answered Oct 11 '22 23:10

user3369577