Results 1 to 4 of 4
  1. #1

    Lightstreamer in Anaconda Python Distribution

    Hello all,

    I've been just starting to try to use the Lightstreamer client in Python 3.9 in the Spyder IDE, and I get an error on import.

    The only line of code I run is:
    Code:
    from lightstreamer_client import *
    and I get the following output:
    Code:
    Traceback (most recent call last):
    
      Cell In[1], line 1
        from lightstreamer_client import *
    
    
      File ~\anaconda3\envs\Economic\lib\site-packages\lightstreamer_client\__init__.py:1
        from .com_lightstreamer_client import *
    
    
      File ~\anaconda3\envs\Economic\lib\site-packages\lightstreamer_client\com_lightstreamer_client.py:16034
        com_lightstreamer_internal_EventDispatcher.executor = com_lightstreamer_internal_EventDispatcher.createExecutor()
    
    
      File ~\anaconda3\envs\Economic\lib\site-packages\lightstreamer_client\com_lightstreamer_client.py:2318 in createExecutor
        return hx_concurrent_executor_Executor.create(1)
    
    
      File ~\anaconda3\envs\Economic\lib\site-packages\lightstreamer_client\com_lightstreamer_client.py:1902 in create
        return hx_concurrent_executor_ThreadPoolExecutor(maxConcurrent,autostart)
    
    
      File ~\anaconda3\envs\Economic\lib\site-packages\lightstreamer_client\com_lightstreamer_client.py:1978 in __init__
        super().__init__()
    
    
      File ~\anaconda3\envs\Economic\lib\site-packages\lightstreamer_client\com_lightstreamer_client.py:1887 in __init__
        super().__init__()
    
    
      File ~\anaconda3\envs\Economic\lib\site-packages\lightstreamer_client\com_lightstreamer_client.py:1781 in __init__
        haxe_Log.trace((("[" + Std.string(self)) + "] instantiated."),_hx_AnonObject({'fileName': "hx/concurrent/Service.hx", 'lineNumber': 56, 'className': "hx.concurrent.ServiceBase", 'methodName': "new"}))
    
    
      File ~\anaconda3\envs\Economic\lib\site-packages\lightstreamer_client\com_lightstreamer_client.py:2316 in _hx_local_0
        python_Lib.printString((("" + Std.string(haxe_Log.formatOutput(v,infos))) + HxOverrides.stringOrNull(python_Lib.lineEnd)))
    
    
      File ~\anaconda3\envs\Economic\lib\site-packages\lightstreamer_client\com_lightstreamer_client.py:1687 in printString
        python_lib_Sys.stdout.buffer.write(_hx_str.encode("utf-8", "strict"))
    
    
    AttributeError: 'TTYOutStream' object has no attribute 'buffer'
    
    
    
    
    from lightstreamer import *
    
    
    import lightstreamer_client
    Traceback (most recent call last):
    
    
      Cell In[3], line 1
        import lightstreamer_client
    
    
      File ~\anaconda3\envs\Economic\lib\site-packages\lightstreamer_client\__init__.py:1
        from .com_lightstreamer_client import *
    
    
      File ~\anaconda3\envs\Economic\lib\site-packages\lightstreamer_client\com_lightstreamer_client.py:16034
        com_lightstreamer_internal_EventDispatcher.executor = com_lightstreamer_internal_EventDispatcher.createExecutor()
    
    
      File ~\anaconda3\envs\Economic\lib\site-packages\lightstreamer_client\com_lightstreamer_client.py:2318 in createExecutor
        return hx_concurrent_executor_Executor.create(1)
    
    
      File ~\anaconda3\envs\Economic\lib\site-packages\lightstreamer_client\com_lightstreamer_client.py:1902 in create
        return hx_concurrent_executor_ThreadPoolExecutor(maxConcurrent,autostart)
    
    
      File ~\anaconda3\envs\Economic\lib\site-packages\lightstreamer_client\com_lightstreamer_client.py:1978 in __init__
        super().__init__()
    
    
      File ~\anaconda3\envs\Economic\lib\site-packages\lightstreamer_client\com_lightstreamer_client.py:1887 in __init__
        super().__init__()
    
    
      File ~\anaconda3\envs\Economic\lib\site-packages\lightstreamer_client\com_lightstreamer_client.py:1781 in __init__
        haxe_Log.trace((("[" + Std.string(self)) + "] instantiated."),_hx_AnonObject({'fileName': "hx/concurrent/Service.hx", 'lineNumber': 56, 'className': "hx.concurrent.ServiceBase", 'methodName': "new"}))
    
    
      File ~\anaconda3\envs\Economic\lib\site-packages\lightstreamer_client\com_lightstreamer_client.py:2316 in _hx_local_0
        python_Lib.printString((("" + Std.string(haxe_Log.formatOutput(v,infos))) + HxOverrides.stringOrNull(python_Lib.lineEnd)))
    
    
      File ~\anaconda3\envs\Economic\lib\site-packages\lightstreamer_client\com_lightstreamer_client.py:1687 in printString
        python_lib_Sys.stdout.buffer.write(_hx_str.encode("utf-8", "strict"))
    
    
    AttributeError: 'TTYOutStream' object has no attribute 'buffer'

  2. #2
    Hello,


    Unfortunately, we have no experience with Anaconda and Spyder IDE.
    Can you suggest what tools we need to install to reproduce your environment?

  3. #3
    Hello and thanks,

    Anaconda distribution with Spyder and Command prompt installed.
    Perform a regular pip install of the lightstreamer library through the command prompt in Anaconda.
    In Spyder, enter "from lightstreamer_client import *" (depending on version you may need to say lightstreamer.client or lightstreamer_client)
    you will reproduce the error above.

    Thanks!

  4. #4
    The error is from a third-party library used by the Lightstreamer Python Client, which tries to print some logs to the virtual console of the Spyder IDE. It seems that this console has some limitations with respect to the standard console. Indeed if you run the same code from the Anaconda Prompt, the Client works as expected.


    If possible, I’ll try to fix this issue in a next release of the SDK, but in the meantime my advice is to write your program with Spyder but to run it only from the Anaconda Prompt.

 

 

Similar Threads

  1. Python client for lightstreamer
    By Colombao in forum Client SDKs
    Replies: 79
    Last Post: July 7th, 2020, 09:05 AM
  2. php/perl/python lightstream client
    By Eli Shabtay in forum Client SDKs
    Replies: 1
    Last Post: May 11th, 2015, 08:48 AM
  3. php/perl/python lightstream client
    By Eli Shabtay in forum General
    Replies: 1
    Last Post: May 11th, 2015, 08:48 AM
  4. Python Client Library for Lightstreamer
    By Alessandro in forum Client SDKs
    Replies: 1
    Last Post: December 18th, 2014, 05:15 PM
  5. how to comunicate lightstreamer server by python
    By keyan in forum Client SDKs
    Replies: 4
    Last Post: December 18th, 2014, 05:12 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 01:32 AM.