问答交流

【代码报错】ModuleNotFoundError: No module named 'zipline'

由lookit创建,最终由small_q 被浏览 7 用户

ModuleNotFoundError:

ModuleNotFoundError Traceback (most recent call last) Cell In[3], line 163 160 stock_num = np.floor(cash/price/100)*100 # 向下取整 161 context.order(context.symbol(instrument), stock_num) # 整百下单 --> 163 from zipline.finance.order import Order 165 #插入定单 166 def insert_order(context,date,instr,amount): ModuleNotFoundError: No module named 'zipline'

尝试安装zipline失败,提示python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [2980 lines of output] Running from numpy source directory. /tmp/pip-install-jmrk02di/numpy_67c5ac8f843743f4ab78a40c0f272100/numpy/distutils/misc_util.py:469: SyntaxWarning: "is" with a literal. Did you mean "=="? return is_string(s) and ('*' in s or '?' is s) blas_opt_info: blas_mkl_info: libraries mkl_rt not found in ['/opt/pyenv/versions/3.11.8/lib', '/usr/local/lib64', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/'] NOT AVAILABLE blis_info: libraries blis not found in ['/opt/pyenv/versions/3.11.8/lib', '/usr/local/lib64', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/'] NOT AVAILABLE openblas_info: libraries openblas not found in ['/opt/pyenv/versions/3.11.8/lib', '/usr/local/lib64', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/'] NOT AVAILABLE atlas_3_10_blas_threads_info:

...

× pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip. [notice] A new release of pip is available: 24.0 -> 24.3.1 [notice] To update, run: pip install --upgrade pip Note: you may need to restart the kernel to use updated packages.

*Output is truncated. View as a open in a text editor. Adjust cell output settings...*请问如何解决?

评论
{link}