I have gone through the Zipline sample strategy and understand all the code. I then went to edit the code to implement my own strategy. However, upon the first step of importing the necessary packages, I receive an error. Here is how to recreate the issue and the error I am getting:
-
Open a new research notebook in Python
-
type the following into an empty cell:
import zipline.api as algo
from zipline.pipeline import Pipeline
from zipline.pipeline.factors import AverageDollarVolume, Returns
from zipline.finance.execution import MarketOrder
- Hit shift + enter to run the cell
The error received is the following:
ModuleNotFoundError Traceback (most recent call last)
in
----> 1 import zipline.api as algo
2 from zipline.pipeline import Pipeline
3 from zipline.pipeline.factors import AverageDollarVolume, Returns
4 from zipline.finance.execution import MarketOrder
ModuleNotFoundError: No module named 'zipline'
NOTE: I have also tried running "from quantrocket import zipline" before the code above. "from quantrocket import zipline" works, however I still then receive an error when importing those other packages.