microsoft / microsoft/qlib

Online client sample codes failed

Open
#184 12 comments 0 reactions 1 assignee View on GitHub

@zhupr is already working on this.

Since Jan 8, 2021.

bug
Dominant language
Python
Stars
48.7k
Forks
7.7k
PR merge metrics
No merged PRs in 30d

Description

🐛 Bug Description

Following https://github.com/microsoft/qlib-server#using-qlib-in-online-mode, the codes failed at
ins = D.list_instruments(D.instrumetns("all"), as_list=True)
with error:
BadNamespaceError Traceback (most recent call last)

To Reproduce

Steps to reproduce the behavior:

  1. One key deploy using docker-compose
  2. Run the sample codes
~/git/qlib/examples/test.py in 
     81 
     82 qlib.init(**ONLINE_CONFIG)
---> 83 ins = D.list_instruments(D.instruments("all"), as_list=True)
     84 
     85 

~/.local/lib/python3.8/site-packages/qlib/data/data.py in list_instruments(self, instruments, start_time, end_time, freq, as_list)
    948 
    949     def list_instruments(self, instruments, start_time=None, end_time=None, freq="day", as_list=False):
--> 950         return Inst.list_instruments(instruments, start_time, end_time, freq, as_list)
    951 
    952     def features(

~/.local/lib/python3.8/site-packages/qlib/data/data.py in list_instruments(self, instruments, start_time, end_time, freq, as_list)
    808             return instrument
    809 
--> 810         self.conn.send_request(
    811             request_type="instrument",
    812             request_content={

~/.local/lib/python3.8/site-packages/qlib/data/client.py in send_request(self, request_type, request_content, msg_queue, msg_proc_func)
     99         self.sio.on(request_type + "_response", request_callback)
    100         self.logger.debug("try sending")
--> 101         self.sio.emit(request_type + "_request", request_content)
    102         self.sio.wait()

~/.local/lib/python3.8/site-packages/socketio/client.py in emit(self, event, data, namespace, callback)
    326         namespace = namespace or '/'
    327         if namespace not in self.namespaces:
--> 328             raise exceptions.BadNamespaceError(
    329                 namespace + ' is not a connected namespace.')
    330         self.logger.info('Emitting event "%s" [%s]', event, namespace)

BadNamespaceError: / is not a connected namespace.

Expected Behavior

Screenshot

Environment

Note: User could run cd scripts && python collect_info.py all under project directory to get system information
and paste them here directly.

Qlib version: 0.6.1

Python version: ['3.8.5 (default, Jul 28 2020, 12:59:40) ', '[GCC 9.3.0]']

linux_distribution: N/A
system: Linux
machine: x86_64
platform: Linux-4.19.104-microsoft-standard-x86_64-with-glibc2.29
version: #1 SMP Wed Feb 19 06:37:35 UTC 2020

Additional Notes

sockerio version is latest 5.0.4 which is not what qlib recommends. But when I manually installed socketio 3.1.2, it thrown other probem which can't connect server.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.