Hi,
If you are using the local system, it seems the pyfolio python library is not installed or not properly installed.
As you know, the library pyfolio developed by Quantopian can become unstable.
This is why we install pyfolio reloaded which is essentially the same library but maintained in a better manner. If you are working on your local system, then you can open jupyter notebook and in a new line try
pip install pyfolio-reloaded
Further, if you get error when you try pf.create_simple_tear_sheet(data.strategy_returns) then as a fix, before you call the line of code
pf.create_simple_tear_sheet(data.strategy_returns) add the following line
pd.Series.iteritems = pd.Series.items