我应该从错误中推断出什么:AttributeError:'str'对象没有属性'setdefault'

时间:2019-11-25 08:54:46

标签: python-3.x github

我有一个python信息库,它试图与网络上可用的数据库连接并收集相关数据。现在,当我从本地计算机运行存储库时,将获得所需的数据库,并因此获得输出。

但是,当我从Windows Server运行相同的代码并尝试连接相同的网站(代理)时,出现上述错误。

  1. 我已经安装/卸载了相应的ODBC驱动程序,但是没有运气
  2. 有人可以建议我采取任何方法摆脱这种情况吗?
    (ssf) C:\Users\admin-prakuma3\data-model_1>python main.py
    Traceback (most recent call last):
    File "main.py", line 612, in <module>
    salesforce_daily_extractors()
    File "main.py", line 44, in salesforce_daily_extractors
    'StartDate': 'StartDate'
    File "C:\Users\admin-prakuma3\data-model_1\SalesforceExtractor.py", line 23, in __run__ 
    fields = sg.getConnection(sg).__getattr__(sfdc_object).describe()['fields']
    File "C:\Users\admin-prakuma3\data-model_1\SalesforceGateway.py", line 19, in getConnection
    security_token='************', proxies="*******:8080")
    File "C:\Users\admin-prakuma3\.conda\envs\ssf\lib\site-packages\simple_salesforce\api.py", line 146, in __init__
  domain=self.domain)
  File "C:\Users\admin-prakuma3\.conda\envs\ssf\lib\site-packages\simple_salesforce\login.py", line 168, in SalesforceLogin
  proxies=proxies)
  File "C:\Users\admin-prakuma3\.conda\envs\ssf\lib\site-packages\requests\sessions.py", line 535, in post
  return self.request('POST', url, data=data, json=json, **kwargs)
  File "C:\Users\admin-prakuma3\.conda\envs\ssf\lib\site-packages\requests\sessions.py", line 479, in request
  prep.url, proxies, stream, verify, cert
  File "C:\Users\admin-prakuma3\.conda\envs\ssf\lib\site-packages\requests\sessions.py", line 656, in merge_environment_settings
  proxies.setdefault(k, v)
  AttributeError: 'str' object has no attribute 'setdefault'

0 个答案:

没有答案