0

I recently converted a text-based adventure game to a .exe using PyInstaller for my friend to view it easily. But when I test the exe file myself, every time it comes across an 'input()', it gives me this error:

Traceback (most recent call last):
  File "ADVENTURE.py", line 37, in <module>
    what_is_your_name = input()
  File "<string>", line 1, in <module>
NameError: name 'test' is not defined

Anyone know why this is? input() is a big part of my game and I would really appreciate it if there is any way to fix this. Thanks!

ztepper
  • 3
  • 5

1 Answers1

2

This is what happens with input() in Python 2. It looks like your PyInstaller is compiling the program with Python 2. You need to configure it to compile that program with Python 3.

TigerhawkT3
  • 48,464
  • 6
  • 60
  • 97