Topics

Forum Topics not found

Replies

gerald.hoxha94
02 Oct 2022, 16:56

RE:

kyosuke said:

Hi, I'm testing the sample script from this page but I get the following error:

Traceback (most recent call last):
  File "c:\Users\Python\OpenApiPy\app.py", line 44, in <module>
    client = Client(EndPoints.PROTOBUF_LIVE_HOST if hostType.lower() == "live" else EndPoints.PROTOBUF_DEMO_HOST, EndPoints.PROTOBUF_PORT, TcpProtocol)
  File "C:\Users\AppData\Local\Programs\Python\Python310\lib\site-packages\ctrader_open_api\client.py", line 13, in __init__
    endpoint = clientFromString(self._runningReactor, f"ssl:{host}:{port}")
  File "C:\Users\AppData\Local\Programs\Python\Python310\lib\site-packages\twisted\internet\endpoints.py", line 2116, in clientFromString
    kwargs = _clientParsers[name](*args, **kwargs)
  File "C:\Users\AppData\Local\Programs\Python\Python310\lib\site-packages\twisted\internet\endpoints.py", line 2000, in _parseClientSSL
    return _parseClientSSLOptions(kwargs)
  File "C:\Users\AppData\Local\Programs\Python\Python310\lib\site-packages\twisted\internet\endpoints.py", line 1965, in _parseClientSSLOptions    
    configuration = CertificateOptions(
NameError: name 'CertificateOptions' is not defined. Did you mean: 'certificateOpenSSL'?

how can I fix it?

 

You're missing OpenSSL, 

install it with `` pip3 install pyOpenSSL ``

Tested on Ubuntu 22.04


@gerald.hoxha94