简体   繁体   English

滑索错误。 没有名为 zipline 的模块

[英]zipline error. No module named zipline

I installed zipline package via Enthought Cantopy.我通过 Enthought Cantopy 安装了 zipline 包。 Now I try to run a script using it in command prompt, but get error ImportError: No module named zipline .现在我尝试在命令提示符下使用它运行一个脚本,但得到错误ImportError: No module named zipline

I also tried to run the same code using IPython, with the same output.我还尝试使用 IPython 运行相同的代码,并具有相同的输出。

I think it is related to python virtual environments, but don't know how to fix that.我认为这与 python 虚拟环境有关,但不知道如何解决。

I figured it out.我想到了。 The problem was in the version of python I have.问题出在我拥有的 python 版本中。 I have 32-bit python and Enthought Cantopy with 64 bit python, installed zipline package was under 64 bit python while command prompt was using 32 bit version.我有 32 位 python 和带有 64 位 python 的 Enthought Cantopy,安装的zipline包在 64 位 python 下,而命令提示符使用 32 位版本。 Installing 64 bit python fixed the issue.安装 64 位 python 解决了这个问题。

These are the Requirements/ Steps to Make Zipline Work:这些是使 Zipline 工作的要求/步骤:

  1. Install Microsoft Visual C++ 2010 Express安装 Microsoft Visual C++ 2010 Express
  2. Download and install python 3.4下载并安装python 3.4
  3. Download zipline from github and Extract in C:/从 github 下载 zipline 并在 C:/ 中提取
  4. Set Anaconda as project interpreter将 Anaconda 设置为项目解释器
  5. Since zipline is compatible with Python 3.4, you need to create an environment with Python 3.4由于 zipline 与 Python 3.4 兼容,因此您需要使用 Python 3.4 创建环境
  6. Run this command in console of IDE: $conda create -n python34 python=3.4 anaconda (replace py34 with the location of python34 folder)在 IDE 的控制台中运行此命令: $conda create -n python34 python=3.4 anaconda (将 py34 替换为 python34 文件夹的位置)
  7. Now run this command in console: $activate python34 #Activates the python 3.4 environment现在在控制台运行这个命令: $activate python34 #Activates the python 3.4 environment
  8. $pip install -e C:\\GitHub\\zipline (Directory where you extracted zipline) $pip install -e C:\\GitHub\\zipline (解压zipline的目录)
  9. Ingest data from quandl with below command $zipline ingest使用以下命令从 quandl 中$zipline ingest数据$zipline ingest zipline ingest

Hope this helps others who visit this page!希望这对访问此页面的其他人有所帮助!

The latest Zipline-Trader version was released.发布了最新的 Zipline-Trader 版本。 For stable version pip install zipline-trader For more info follow docs for installation.对于稳定版本pip install zipline-trader有关更多信息,请按照文档进行安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM