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.

Raw input is not defined

See original GitHub issue

Installing on ArchLinux with

sudo pip install shutit # defaults to pip3

and then running

shutit skeleton

results in the following error: NameError: name 'raw_input' is not defined

Full traceback:

Traceback (most recent call last):                
  File "./shutit.py", line 60, in <module>        
    main()                                        
  File "./shutit.py", line 53, in main            
    shutit.setup_shutit_obj()                     
  File "/home/liam/shutit/shutit_class.py", line 3907, in setup_shutit_obj                           
    self.parse_args()                             
  File "/home/liam/shutit/shutit_class.py", line 3559, in parse_args                                 
    vagrant_docker=args.vagrant_docker))          
  File "/home/liam/shutit/shutit_class.py", line 3119, in process_args                               
    self.handle_skeleton(args)                    
  File "/home/liam/shutit/shutit_class.py", line 3218, in handle_skeleton                            
    module_directory = shutit_util.util_raw_input(prompt='# Input a name for this module.\n# Default: ' + default_dir + '\n', default=default_dir)                                                        
  File "/home/liam/shutit/shutit_util.py", line 250, in util_raw_input                               
    resp = raw_input(prompt).strip()              
NameError: name 'raw_input' is not defined        

I then installed with pip2.7 and it’s working now, but I was unable to see this anywhere other than your setup.py file. Shouldn’t it be documented somewhere more visible, eg. the Readme or your website? I almost gave up experimenting with this tool, maybe other people would too.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
ianmiellcommented, Jun 13, 2017

This should be fixed now as of 1.0.3

0reactions
setopcommented, Feb 13, 2018

ShutIt version: 1.0.47 Python 3.5.2

I got the error :

File "/home/mrloyal/Temp/shutit/lib/python3.5/site-packages/shutit_util.py", line 247, in util_raw_input
    return input(prompt).strip() or default
UnboundLocalError: local variable 'input' referenced before assignment

Line 237 of the same file, I commented out input = raw_input and now it works, no more error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NameError: name 'raw_input' is not defined - Stack Overflow
I tried changing the code, but it seems to not like the raw_input(). python · raw-input · Share.
Read more >
NameError: name 'raw_input' is not defined in Python
The Python "NameError: name 'raw_input' is not defined" occurs when we use the raw_input() function in Python 3. To solve the error, ...
Read more >
NameError name raw input is not defined | Edureka Community
Hi,. There may a problem with your python version. Raw_input() will work in the lower version of Python. From Python3.x, input() replaces ...
Read more >
name 'raw_input' is not defined” in Python - Quora
In python3, change all the instances of [code ]raw_input[/code] in your code to [code ]input[/code]. (Or else run the module on python2)
Read more >
NameError: name 'raw_input' is not defined in Python
The “name raw_input is not defined” error arises when the user uses the “raw_input()” function in Python3. To solve this, use the simple...
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