Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Datastream /
avatar image
Question by howard.wen1 · Apr 14, 2020 at 07:11 PM · datastreamdatastream in pythonpython dswsdatastream web service

New DSWS user can't connect for Python 3.6

Hi, I'm a new Datastream WebServices user. I tried to connect to DatastreamDSWS via Python using the following code:


import DatastreamDSWS as DSWS

ds = DSWS.Datastream(username="XXXXXXX", password="XXXXXXXX")


but have been getting the following error:


_get_token : Exception Occured
(<class 'AttributeError'>, AttributeError("'str' object has no attribute 'name'"), <traceback object at 0x10f9b1320>)
None


Traceback (most recent call last):
  File "/opt/anaconda3/envs/recommendation_2020/lib/python3.7/site-packages/DatastreamDSWS/DS_Response.py", line 259, in _get_token
    verify=self.certfile.name).json()
AttributeError: 'str' object has no attribute 'name'

I'm assuming my DSWS account is active as was able to get a token from: http://product.datastream.com/DswsClient/Docs/TestSoapV1.aspx

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

2 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by jirapongse.phuriphanvichai · Apr 15, 2020 at 06:38 AM

@howard.wen1

I can replicate this issue on the Linux system (Non-Windows). It looks like to be a bug in the library. The workaround is using this code:

import requests
ds = DSWS.Datastream(username = 'xxxxx', password = 'xxxx', sslCer=requests.certs.where())

You can also raise this issue via GitHub.

Comment

People who like this

0 Show 1 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
howard.wen1 · Apr 15, 2020 at 01:34 PM 0
Share

That did the trick. Thanks!

avatar image
REFINITIV
Answer by wasin.waeosri · Apr 15, 2020 at 03:07 AM

Hello @howard.wen1

I cannot replicate the issue with DatastreamDSWS version 1.0.2 and Python versions 3.6.10, 3.7.7 in my environment.

Which version of DatastreamDSWS that you are using? You can use pip list command in your active environment to check the installed libraries versions.

(dsws36) C:\>pip list
Package         Version
--------------- -------------------
certifi         2020.4.5.1
chardet         3.0.4
DatastreamDSWS  1.0.2
DateTime        4.3
idna            2.9
numpy           1.18.2
pandas          1.0.3
pip             20.0.2
python-dateutil 2.8.1
pytz            2019.3
requests        2.23.0
setuptools      46.1.3.post20200330
six             1.14.0
urllib3         1.25.8
wheel           0.34.2
wincertstore    0.2
zope.interface  5.1.0



python36.png (18.9 KiB)
python37.png (17.9 KiB)
Comment
SupDev1

People who like this

1 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
8 People are following this question.

Related Questions

How to check the status of Instrument (Active or Inactive) using dsws ??

Is there any way to go from SEDOL to mnemonic?

How can I figure out Forward PTS Data?

Retrieving vintage matrix works for certain mnemonics but not others?

Unable to pull multiple economic time series with pydatastream

  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges