Zipline import error. No module named zipline.transforms
Asked Answered
R

2

3

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'
Rhombus answered 8/6, 2016 at 8:7 Comment(1)
Did you figure out what was causing this issue?Piazza
U
0

Disclaimer: I'm currently a maintainer of Zipline.

I'm guessing the reason you're seeing this error is because that particular module was removed a while back (assuming you're using zipline 1.0.0 or later). If you want to do things similar to transforms you'll need to call data.history() to get your pricing data, and call numpy/pandas functions like .avg() or .std(), or use talib.

Undenominational answered 12/1, 2018 at 19:41 Comment(0)
P
0

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.

Privatdocent answered 25/7, 2018 at 8:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.