Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Object-Oriented Python (retired) Hack-n-Slash The Final Push

Tatiana Perry
Tatiana Perry
17,156 Points

Game doesn't run locally

I downloaded my workspace. It runs on the treehouse environment, but when I tried to run it locally I get this error:

Tatianas-MacBook-Pro% python game.py
Name: tatiana
Traceback (most recent call last):
  File "game.py", line 91, in <module>
    Game()
  File "game.py", line 73, in __init__
    self.setup()
  File "game.py", line 11, in setup
    self.player = Character()
  File "/Users/tatianaperry/Downloads/project/character.py", line 33, in __init__
    self.name = input("Name: ")
  File "<string>", line 1, in <module>
NameError: name 'tatiana' is not defined

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,423 Points

Make sure you are running Python 3 which interprets all input as strings. If you're running Python 2, try entering "tatiana" (with quotation marks)

Tatiana Perry
Tatiana Perry
17,156 Points

That moment when you facepalm. Thanks!