Connecting to WRDS through Python gives PAM authentication failed error

385 Views Asked by At

I am trying to connection WRDS using the simple code below:

import wrds

conn = wrds.Connection()

When I run the code, I am prompted for my username and password, which I type in. However, in response, I get the following error message:

OperationalError: (psycopg2.OperationalError) connection to server at "wrds-pgdata.wharton.upenn.edu" (192.168.9.200), port 9737 failed: FATAL:  PAM authentication failed for user "tmohammed"

(Background on this error at: https://sqlalche.me/e/14/e3q8)`

Any ideas on how I can get around this? I am trying this on Jupyter Notebook. FYI, my WRDS account is a PhD account under the name of my university.

2

There are 2 best solutions below

0
On

The way to solve this is to contact WRDS. If there is no requests going through DUO, it means there is a problem with your username and/or password. Reset your password on WRDS and try again, it should work.

0
On

This could be the result of the 2FA adopted by WRDS relatively recently. You may want to SSH into WRDS from your machine and do 2FA and then check if the wrds package works from the same machine after that.