I have found getpass does not work in PyCharm. It just hangs.
In fact is seems msvcrt.getch and raw_input also don\'t work, so perhaps the issue is not with getpass
A common solution to this would be to store the credentials in a file which you mark ignored by your VCS. Then just:
with open('credentials.txt') as f:
user, pw = f.read().split('\n') # or similar
Alternatively, have them specified in environment variables. Both of these methods should work around PyCharm's handling of stdin.