Skip to content

import 的时候报错,找不到'mr_eval_context' #38

@GuardHa

Description

@GuardHa

{
"name": "AttributeError",
"message": "function 'mr_eval_context' not found",
"stack": "---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[12], line 1
----> 1 import qstock as qs

File ~\AppData\Roaming\Python\Python312\site-packages\qstock\init.py:9
3 '''
4 @author :Jinyi Zhang
5 @Date :2022/9/29 20:20
6 '''
7 #数据模块
8 #股票、债券、期货、基金等交易行情数据
----> 9 from qstock.data.trade import *
11 #新闻数据
12 from qstock.data.news import *

File ~\AppData\Roaming\Python\Python312\site-packages\qstock\data\trade.py:21
18 from jsonpath import jsonpath
19 from datetime import datetime, timedelta
---> 21 from qstock.data.util import (request_header, session, market_num_dict,
22 get_code_id, trans_num, trade_detail_dict, )
24 signal.signal(signal.SIGINT, multitasking.killall)
26 #获取某市场所有股票/债券/基金代码

File ~\AppData\Roaming\Python\Python312\site-packages\qstock\data\util.py:150
120 js_str = """
121 function mcode(input) {
122 var keyStr = "ABCDEFGHIJKLMNOP" + "QRSTUVWXYZabcdef" + "ghijklmnopqrstuv" + "wxyz0123456789+/" + "=";
(...)
147 }
148 """
149 random_time_str = str(int(time.time()))
--> 150 js_code = py_mini_racer.MiniRacer()
151 js_code.eval(js_str)
152 mcode = js_code.call("mcode", random_time_str)

File ~\AppData\Roaming\Python\Python312\site-packages\py_mini_racer\py_mini_racer.py:178, in MiniRacer.init(self)
176 def init(self):
177 if self.class.ext is None:
--> 178 self.class.ext = _build_ext_handle()
180 self.ctx = self.ext.mr_init_context(" ".join(self.v8_flags).encode("utf-8"))
181 self.lock = threading.Lock()

File ~\AppData\Roaming\Python\Python312\site-packages\py_mini_racer\py_mini_racer.py:132, in _build_ext_handle()
129 _ext_handle.mr_init_context.argtypes = [ctypes.c_char_p]
130 _ext_handle.mr_init_context.restype = ctypes.c_void_p
--> 132 _ext_handle.mr_eval_context.argtypes = [
133 ctypes.c_void_p,
134 ctypes.c_char_p,
135 ctypes.c_int,
136 ctypes.c_ulong,
137 ctypes.c_size_t]
138 _ext_handle.mr_eval_context.restype = ctypes.POINTER(MiniRacerValueStruct)
140 _ext_handle.mr_free_value.argtypes = [ctypes.c_void_p, ctypes.c_void_p]

File c:\Program Files\Python312\Lib\ctypes\init.py:392, in CDLL.getattr(self, name)
390 if name.startswith('') and name.endswith(''):
391 raise AttributeError(name)
--> 392 func = self.getitem(name)
393 setattr(self, name, func)
394 return func

File c:\Program Files\Python312\Lib\ctypes\init.py:397, in CDLL.getitem(self, name_or_ordinal)
396 def getitem(self, name_or_ordinal):
--> 397 func = self._FuncPtr((name_or_ordinal, self))
398 if not isinstance(name_or_ordinal, int):
399 func.name = name_or_ordinal

AttributeError: function 'mr_eval_context' not found"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions