Datastream API with visual studio code

RC05
RC05 Newcomer
edited March 6 in Datastream

I'm trying to set up the Datastream API with visual studio code. But keep getting the following error message - see attached. Please help!

ds = dsweb.DataClient (None, '', '')

---------------------------------------------------------------------------FileNotFoundError Traceback (most recent call last)Cell In[2], line 1----> 1 ds = dsweb.DataClient (None, '', '')File ~\AppData\Roaming\Python\Python312\site-packages\DatastreamPy\DS_Response.py:143, in DataClient.__init__(self, config, username, password, proxies, sslVerify, sslCert) 141 self._certfiles = "tempCertFile.pem" 142 import ssl--> 143 with open(self._certfiles, "w+",) as file_obj: 144 for store in ["CA", "ROOT", "MY"]: 145 for cert, encoding, trust in ssl.enum_certificates(store):FileNotFoundError: [Errno 2] No such file or directory: 'tempCertFile.pem'

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @RC05

    Thank you for reaching out to us.

    Can use run this one on Visual Studio Code?

    f =  open("tempCertFile.pem", "w+",)
    print(f.name)
    

    What version of Python are you using?

  • RC05
    RC05 Newcomer

    i'm using python 3.12.7.

    Tried running the code - see below

    image.png
  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @RC05

    It may relate to the Visual Studio Code settings, as mentioned in this discussion.