question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

exit isn't recognized as a command

See original GitHub issue

Description of your problem

What steps will reproduce the problem?

  1. Create a simple script
  2. At the end of the script, add the command exit()
  3. 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:closed
  • Created 6 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
eliot1785commented, Jul 15, 2017

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.

1reaction
ccordoba12commented, Jul 14, 2017

I can’t reproduce this problem on Linux. @dalthviz, please take a look at this one on Windows.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Window script to exit itself if command not recognized
I want to write a window script to exit script if an command is not recognized as internal or external command.
Read more >
Getting "exit status 1: 'C:\Program' is not recognized as an ...
The problem is with the spaces in URL(C:\Program Files). Try to install the nvm directly in C:/ or in other folder without spaces...
Read more >
exit command not working :: Support Forum - WinSCP
i have the following batch file to get the files in a dir script runs fine but will not exit and logoff server...
Read more >
Inconsistent exit code from powershell.exe using exit ...
I see that after calling "powershell.exe exit2.ps1" or variants thereof from a windows command prompt, echo %errorlevel% is not reliably ...
Read more >
Recognising prompts and how to exit - GitHub Pages
When working at the command line, you might not recognise your prompt. On this page you will find tips to discover where you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found