2

I am using very simple code on ipython notebook for user to input password. Command hangs after user inputs the password. Here is my code sample -

import getpass

try:
    p = getpass.getpass()
except Exception as error:
    print('ERROR', error)
else:
    print('Password entered:', p)

I tried raw_input() as well, it hangs exactly the same way.

try:
    p = raw_input()
except Exception as error:
    print('ERROR', error)
else:
    print('Password entered:', p)

Any idea what's the solution for this.

I am running jupyter notebook on AWS server. Here are the version details -

    Python 2.7.13 |
    Anaconda 2.5.0 (64-bit)| (default, Dec 20 2016, 23:09:15) 
    GCC 4.4.7 20120313 
    Red Hat 4.4.7-1
    IPython.__version__ '4.0.3'
Sangy
  • 21
  • 2
  • 1
    What's your Jupyter notebook version? You IPython version is pretty old, considering that the most recent Python 2 version of IPython is 5.4. This could be causing the problem – Louise Davies Dec 13 '17 at 10:01
  • Hi Louise, thanks for your response. This is what I found out about Jupyter version -jupyter 1.0.0 py27_1 jupyter_client 4.1.1 py27_0 jupyter_console 4.1.0 py27_0 jupyter_core 4.0.6 py27_0 – Sangy Dec 14 '17 at 16:31
  • Thank you Louise! Upgrading ipython solved the problem. – Sangy Dec 14 '17 at 16:41
  • Louise, consider making an answer out of your comments as this was the right solutions. – Matt Dec 15 '17 at 10:31

0 Answers0