-3

Throws error: Line 2: AttributeError: '<invalid type>' object has no attribute 'exit' when from sys import exit is run. How do I fix this? Problem part of code:

from sys import exit
wjandrea
  • 16,334
  • 5
  • 30
  • 53
Jenny Wen
  • 1
  • 1
  • 4

1 Answers1

0

Did you happen to create a module or file called sys? If so you are importing from your local module rather than from the built-in Python sys module

Otherwise, these import commands are case sensitive, make sure everything is in lower case (it is in your post, but you never know):

from sys import exit
EoinS
  • 4,346
  • 1
  • 14
  • 27