Getting below error after installing pylivetrader and tried to run a simple example. The issue seems to be with pandas and wondering if anyone can shed some light on how to solve this.
Appreciate the help in advance.
-vg
c:\spb_data.conda\envs\alpaca\lib\site-packages\pylivetrader\misc\pd_utils.py:20: FutureWarning: The pandas.tslib module is deprecated and will be removed in a future version.
from pandas.tslib import normalize_date # noqa
Traceback (most recent call last):
File “c:\spb_data.conda\envs\alpaca\lib\site-packages\pylivetrader\misc\pd_utils.py”, line 18, in
from pandas._libs.tslib import normalize_date # noqa
ImportError: cannot import name ‘normalize_date’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “c:\spb_data.conda\envs\alpaca\lib\runpy.py”, line 193, in run_module_as_main
“main”, mod_spec)
File “c:\spb_data.conda\envs\alpaca\lib\runpy.py”, line 85, in run_code
exec(code, run_globals)
File "C:\SPB_Data.conda\envs\alpaca\Scripts\pylivetrader.exe_main.py", line 4, in
File "c:\spb_data.conda\envs\alpaca\lib\site-packages\pylivetrader_init.py", line 17, in
from .algorithm import Algorithm # noqa
File “c:\spb_data.conda\envs\alpaca\lib\site-packages\pylivetrader\algorithm.py”, line 30, in
from pylivetrader.data.bardata import handle_non_market_minutes
File “c:\spb_data.conda\envs\alpaca\lib\site-packages\pylivetrader\data\bardata.py”, line 22, in
from pylivetrader.misc.pd_utils import normalize_date
File “c:\spb_data.conda\envs\alpaca\lib\site-packages\pylivetrader\misc\pd_utils.py”, line 20, in
from pandas.tslib import normalize_date # noqa
File “c:\spb_data.conda\envs\alpaca\lib\site-packages\pandas\tslib.py”, line 6, in
from pandas._libs.tslib import (Timestamp, Timedelta,
ImportError: cannot import name ‘Timedelta’
Tried to create new env with fresh installation. Got below error. You can see the list of pandas version below also. Thanks in advance for looking into this issue.
-vg
[2020-10-29 21:28:30.337582] INFO: Algorithm: livetrader start running with backend = alpaca data-frequency = minute
Traceback (most recent call last):
File “c:\users\veguthik.conda\envs\alpaca\lib\runpy.py”, line 193, in _run_module_as_main
“main”, mod_spec)
File “c:\users\veguthik.conda\envs\alpaca\lib\runpy.py”, line 85, in run_code
exec(code, run_globals)
File "C:\Users\veguthik.conda\envs\alpaca\Scripts\pylivetrader.exe_main.py", line 7, in
File “c:\users\veguthik.conda\envs\alpaca\lib\site-packages\click\core.py”, line 829, in call
return self.main(*args, **kwargs)
File “c:\users\veguthik.conda\envs\alpaca\lib\site-packages\click\core.py”, line 782, in main
rv = self.invoke(ctx)
File “c:\users\veguthik.conda\envs\alpaca\lib\site-packages\click\core.py”, line 1259, in invoke
return process_result(sub_ctx.command.invoke(sub_ctx))
File “c:\users\veguthik.conda\envs\alpaca\lib\site-packages\click\core.py”, line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “c:\users\veguthik.conda\envs\alpaca\lib\site-packages\click\core.py”, line 610, in invoke
return callback(*args, **kwargs)
File “c:\users\veguthik.conda\envs\alpaca\lib\site-packages\click\decorators.py”, line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "c:\users\veguthik.conda\envs\alpaca\lib\site-packages\pylivetrader_main.py", line 277, in run
algorithm.run(retry=ctx.retry)
File “c:\users\veguthik.conda\envs\alpaca\lib\site-packages\pylivetrader\algorithm.py”, line 268, in run
self.initialize()
File “c:\users\veguthik.conda\envs\alpaca\lib\site-packages\pylivetrader\algorithm.py”, line 223, in initialize
self.state_store.load(self, self.algoname)
File "c:\users\veguthik.conda\envs\alpaca\lib\site-packages\pylivetrader\statestore_init.py", line 105, in load
loaded_state = self.storage_engine.load()
File "c:\users\veguthik.conda\envs\alpaca\lib\site-packages\pylivetrader\statestore_init.py", line 40, in load
loaded_state = pickle.load(f)
ModuleNotFoundError: No module named ‘pandas._libs.tslibs.timestamps’
packages in environment at C:\Users\username.conda\envs\alpaca:
Hmmmm…Showing the same issue even after uninstalling and re-installing everything from scratch.
I am using Anconda. Wondering if there are any step-by-step instructions from any user who is successful in getting it right?
PS: I know Quantopian is shutting down but I have several algos from there that I want to deploy.
Hopefully pylivetrader would be supported in future also since it is based on zipline.
I followed installed ubuntu virtualenv based on the link that you provided. Still the problem is same.
I finally tried pandas=0.23.0 instead of pandas=0.22.0 even though pylivetrader guthub requirement documents says to use pandas<=0.22.0. I was expecting some kind of error but to my surprise it worked!