question

Upvotes
Accepted
1 0 0 0

DatastreamDSWS cannot retrieve token on Windows server 2016

I am running a Python application from a batch file on a Windows Server 2016 machine.

The Python application connects with the correct username and password in this format:

ds = dsws.Datastream(username, password)

However the applciation persistently fails to connect, showing this error:

_get_token : Exception Occured

(<class 'ModuleNotFoundError'>, ModuleNotFoundError("No module named 'wincertstore'"), <traceback object at 0x0000020C14A1DE00>)

Can you assist?

datastreamrequest-token
icon clock
10 |1500

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

Hi @richard.ali,

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.


Thanks,

AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,
AHS

1 Answer

· Write an Answer
Upvotes
Accepted
78.6k 248 52 74

@richard.ali

On Windows, the DatastreamDSWS library depends on the wincertstore package. You can verify the source code here.

    def _loadWinCerts(self):
        import wincertstore
        cfile = wincertstore.CertFile()
        cfile.addstore('CA')
        cfile.addstore('ROOT')
        cfile.addstore('MY')
        self.certfile = cfile.name
        atexit.register(cfile.close)
        #print(self.certfile.name)

Please install the wincertstore package by using the following command.

pip install wincertstore 


icon clock
10 |1500

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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