exit isn't recognized as a command
See original GitHub issueDescription of your problem
What steps will reproduce the problem?
- Create a simple script
- At the end of the script, add the command exit()
- Run the script, for example via the interface Run->Run
What is the expected output? What do you see instead?
I would expect the program to simply exit. Instead, I get an error “NameError: name ‘exit’ is not defined”. This error does not occur when running directly in python.
Please provide any additional information below
This may be an iPython issue instead of a Spyder issue, I’m not sure.
sys.exit() will succeed in quitting the program, but with a warning message to use exit or quit instead, so it isn’t ideal.
Versions and main components
- Spyder Version: 3.1.4 64 bit
- Python Version: 3.6.1
- iPython Version: 6.1.0
- Qt Version: 5.6.2
- PyQt Version: 5.6
- Operating system: Windows 7
Dependencies
Please go to the menu entry Help > Optional Dependencies (or
Help > Dependencies), press the button Copy to clipboard
and paste the contents below:
jedi >=0.9.0 : 0.10.2 (OK) matplotlib >=1.0 : 2.0.2 (OK) nbconvert >=4.0 : 5.2.1 (OK) numpy >=1.7 : 1.12.1 (OK) pandas >=0.13.1 : 0.20.2 (OK) pep8 >=0.6 : 1.7.0 (OK) pyflakes >=0.6.0 : 1.5.0 (OK) pygments >=2.0 : 2.2.0 (OK) pylint >=0.25 : 1.6.4 (OK) qtconsole >=4.2.0: 4.3.0 (OK) rope >=0.9.4 : 0.9.4-1 (OK) sphinx >=0.6.6 : 1.6.2 (OK) sympy >=0.7.3 : 1.0 (OK)
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (6 by maintainers)

Top Related StackOverflow Question
I think you are making the right decision since the issue I reported is with iPython, not Spyder. Sorry.
And the secondary concern I had isn’t an issue per se, it is just that I don’t like how the iPython interface has decided to handle terminations. That is just a design decision on iPython’s part. You can actually just close this ticket entirely if you don’t want to put it on the wishlist.
I am going to try your new project spyder-terminal since I think what I really want is the terminal feel.
I can’t reproduce this problem on Linux. @dalthviz, please take a look at this one on Windows.