man-group / arctic

High performance datastore for time series and tick data
https://arctic.readthedocs.io/en/latest/
GNU Lesser General Public License v2.1
3.06k stars 583 forks source link

Arctic cannot import Panel from Pandas with newest version of pandas #907

Closed rva92 closed 1 year ago

rva92 commented 3 years ago

Arctic Version

1.79.3

Arctic Store

VersionStore

Platform and version

Windows 10, python 3.7 (anaconda distribution)

Description of problem and/or code sample that reproduces the issue

After upgrading to the latest pandas version (1.2.4), arctic fails with:

Traceback (most recent call last): File "", line 1, in File "C:\Users\rwi\Anaconda3\envs\rvf\lib\site-packages\arctic__init.py", line 6, in from .store._pandas_ndarray_store import PandasDataFrameStore, PandasSeriesStore, PandasPanelStore File "C:\Users\rwi\Anaconda3\envs\rvf\lib\site-packages\arctic\store_pandas_ndarray_store.py", line 6, in from pandas import DataFrame, Series, Panel ImportError: cannot import name 'Panel' from 'pandas' (C:\Users\rwi\Anaconda3\envs\rvf\lib\site-packages\pandas\init__.p

I have tried from an empty environment as well, where I only installed arctic and let arctic install pandas, which turned out to be version 1.2.4, hence it still failed.

chazzmoney commented 3 years ago

Panel has been deprecated since Pandas 0.23. To load a Panel, you will likely need to downgrade to an earlier version of Pandas.

stefanopalmieri commented 3 years ago

The newer versions of Pandas no longer issues a warning for Panel import, as Panel has been fully deprecated.

Release 1.79.x should not have been released without pinning pandas version.

See issues #903, #904

stefanopalmieri commented 3 years ago

If you are using poetry, I suggest you use this github repo to add your arctic dependency, instead of using the release from Pypi, as the pandas version has been pinned in the current master branch. This would be a quick fix to your issue.

poetry add git+https://github.com/man-group/arctic

closedLoop commented 3 years ago

Any progress on this?

rva92 commented 3 years ago

Is there any change, that the arctic library in future will not depend on the depreciated panels feature from pandas?

AlistairHaimes commented 3 years ago

If you need to use a later pandas version than 1.0 (the repository I use doesn't go back that far any longer, with Python 3.9.5 which I need to use for other reasons), I think the latest that currently works (stand to be corrected) is 1.1.5, which will work with Arctic pinned to 1.79.2

i.e.

 pip install pandas==1.1.5
pip install arctic==1.79.2
agftrading commented 1 year ago

Has there been an update for this yet. I have constraints on my python version and pandas version i.e. downgrading is not possible. Thanks.

tigerstyle80 commented 1 year ago

i noticed that that test-df in the first_lib library that ships with this project is available to read using pandas 1.3.5. However, I did see the import error referred to above when i tried a different dataframe. what needs to happen for arctic to be compatible with pandas 1.3*? I'm seeing ML projects starting to require these later pandas versions...

dunckerr commented 1 year ago

The panel issue has been fixed in more recent releases of arctic. I'm afraid we cannot support all combinations of python/pandas.

tigerstyle80 commented 1 year ago

sounds like downgrading is the only way forward in that case. can't be mad at it as i'm not a contributor. thanks anyway.

dbrakenhoff commented 1 year ago

Installing arctic from this PR #928 has worked for me with newer versions of pandas (1.5.2) and numpy (1.21.2). I've only used VersionStore, and its not officially supported so no guarantees... But it is a workaround for getting arctic to work with newer versions of those packages. And you'll have to ignore warnings about package incompatibility in your environment.

dunckerr commented 1 year ago

suppressed Panel FutureWarning