0

我尝试使用wrds.Connection()函数通过 Google Colab 从 WRDS 访问数据。但我得到了 OperationalError。我之前多次通过 Google Colab 从 WRDS 访问数据,但这是我第一次遇到这个问题。我多次更改密码,计算机,浏览器,但仍然无法正常工作。

任何人都请看一下并给我评论,以便我可以解决这个问题。非常感谢!

Enter your WRDS username [root]:.........
Enter your password:........
WRDS recommends setting up a .pgpass file.
You can find more info here:
https://www.postgresql.org/docs/9.5/static/libpq-pgpass.html.
There was an error with your password.
---------------------------------------------------------------------------
OperationalError                          Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/sqlalchemy/engine/base.py in _wrap_pool_connect(self, fn, connection)
       3210         try:
    -> 3211             return fn()
       3212         except dialect.dbapi.Error as e:
    
83 frames
OperationalError: fe_sendauth: no password supplied
    
The above exception was the direct cause of the following exception:
    
OperationalError                          Traceback (most recent call last)
OperationalError: (psycopg2.OperationalError) fe_sendauth: no password supplied
    
(Background on this error at: http://sqlalche.me/e/14/e3q8)
    
During handling of the above exception, another exception occurred:
    
OperationalError                          Traceback (most recent call last)
OperationalError: could not translate host name "12GO@wrds-pgdata.wharton.upenn.edu" to address: Name or service not known
    
The above exception was the direct cause of the following exception:
    
OperationalError                          Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/psycopg2/__init__.py in connect(dsn, connection_factory, cursor_factory, **kwargs)
        120 
        121     dsn = _ext.make_dsn(dsn, **kwargs)
    --> 122     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
        123     if cursor_factory is not None:
        124         conn.cursor_factory = cursor_factory
    
OperationalError: (psycopg2.OperationalError) could not translate host name "12GO@wrds-pgdata.wharton.upenn.edu" to address: Name or service not known
    
(Background on this error at: http://sqlalche.me/e/14/e3q8) 
4

1 回答 1

0

我没有问题。我使用 安装了wrds!pip install wrds,然后运行conn = wrds.Connection(),输入了我的 WRDS ID 和密码,一切正常。一个想法可能是重新安装库并重试。

于 2021-06-20T23:39:20.360 回答