Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameError: name 'raw_input' is not defined #31

Open
HripsimeS opened this issue Jun 19, 2023 · 1 comment
Open

NameError: name 'raw_input' is not defined #31

HripsimeS opened this issue Jun 19, 2023 · 1 comment

Comments

@HripsimeS
Copy link

@optas @olkido Hello. I am trying to run the train_single_class_ae.ipynb file and I got the error that 'raw_input' is not defined.
Do I need to import it additionally or there was probably an issue with the installations? Hope to hear from you soon!

image

@CPSuperstore
Copy link

TL; DR: Change raw_input to input.

Back in Python 2, if you wanted your code to ask for command line input, you could use either the input or raw_input function. If I recall, input would attempt to convert the input to a number or evaluate the expression or something like that, whereas raw_input simply treated the input as a string.

In Python 3, raw_input and input were merged into the same function (input) which takes the value entered as a string and it is up to the developer to evaluate it explicitly.

It looks like you are using Python 3, and it looks like this code base was written in Python 2, so making the change is nessisary.

Just as a side note, there is also a tool called 2 to 3 for migrating code from Python 2 to 3 which should do most of the work for you if there are any other version issues.

Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants