backtrader connection errors
-
am getting the error''ModuleNotFoundError: No module named 'backtrader'
anytime i run any code in the idefrom future import (absolute_import, division, print_function,
unicode_literals)import backtrader as bt
if name == 'main':
cerebro = bt.Cerebro()print('Starting Portfolio Value: %.2f' % cerebro.broker.getvalue()) cerebro.run() print('Final Portfolio Value: %.2f' % cerebro.broker.getvalue())
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-bd9375d3f4ab> in <module>
2 unicode_literals)
3
----> 4 import backtrader as bt
5
6 if name == 'main':ModuleNotFoundError: No module named 'backtrader'
-
First guess would be that the script you try to run has
backtrader.py
name. Rename it. If it doesn't fix the error, than you have some issue swith the installation. Feel free to google how to fixModuleNotFoundError:
error. Correctly installed and usedbt
doesn't return this error.