本文介绍了Zipline导入错误.没有名为zipline.transforms的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法导入zipline.transforms模块

I am not able to import the zipline.transforms module

>>> from zipline.transforms import batch_transform
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'zipline.transforms'

推荐答案

我认为您应该首先打印出sys.path(print sys.path),然后查看zipline模块的安装位置(例如. ../lib/python2.7/site-packages/zipline ).通常,没有名为XXX的模块"是由您引起的sys.path不包含您​​安装的zipline的路径.您应该只将zipline路径添加到sys.path中.还可以使用anaconda来作为zipline( http://www.zipline.io/install.html),以保持环境整洁和清洁.

I think you should firstly print out your sys.path (print sys.path), and then see where you zipline module is installed (somewhere like .../lib/python2.7/site-packages/zipline). Usually "no module named XXX" is caused by you sys.path doesn't contain the path you installed zipline. You should just add your zipline path into sys.path. Also use anaconda is good for zipline (http://www.zipline.io/install.html), so as to keep the environment tidy and clean.

这篇关于Zipline导入错误.没有名为zipline.transforms的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 19:15