Search code examples
python-2.7freezegetpasswd

Python getpass.getpass() function call hangs


I am trying to get a prompt that will ask for my password but when I try to call getpass.getpass() it just freezes. I am running on Windows 7 64 bit using Python 2.7 on Canopy.

import sys
import getpass

p = getpass.getpass()
print p

Solution

  • Python "effectively freezes because it can't receive the input from standard input". See https://support.enthought.com/entries/22157050-Canopy-Python-prompt-QtConsole-Can-t-run-getpass-or-interactive-OS-shell-commands-or-Windows-process

    The fix is to use a different interpreter. I switched to IDLE and fixed the issue.