kjhall01 / xcast

A High-Performance Data Science Toolkit for the Earth Sciences
MIT License
67 stars 5 forks source link

import error #44

Closed fipoucat closed 5 months ago

fipoucat commented 6 months ago

I installed xcast following instruction on GitHub page but got error when importing the package in Spyder.

import xcast as xc Traceback (most recent call last):

Cell In[1], line 1 import xcast as xc

File /opt/anaconda3/lib/python3.11/site-packages/xcast-0.6.9-py3.9.egg/xcast/init.py:7 from .visualization import view_probabilistic, view_reliability, reliability_diagram, view_taylor, view_roc, view

File /opt/anaconda3/lib/python3.11/site-packages/xcast-0.6.9-py3.9.egg/xcast/visualization/init.py:4 from .roc import view_roc

File /opt/anaconda3/lib/python3.11/site-packages/xcast-0.6.9-py3.9.egg/xcast/visualization/roc.py:3 from scipy import interp

ImportError: cannot import name 'interp' from 'scipy' (/opt/anaconda3/lib/python3.11/site-packages/scipy/init.py)

How can I solve this?

rabbanidu93 commented 5 months ago

For an interim solution, consider using scipy version 1.11.4 or an earlier version. (It appears that the 'roc.py' module in xcast imports the 'interp' submodule from scipy-interpolation, but starting from scipy version 1.12, this submodule is supported as 'interpolate' instead of 'interp'.)

To resolve this, first remove the current version (1.12 or 1.13) of scipy with, conda remove scipy Then install scipy 1.11.4 with, conda install scipy=1.11.4 And finally create a new environment named 'xcast_env' ensuring that it includes scipy version 1.11.4, with, _conda create -n xcastenv -c conda-forge -c hallkjc01 xcast xarray scipy=1.11.4 netcdf4 jupyter ipykernel

fipoucat commented 5 months ago

@rabbanidu93 Thank you so much, I can import now following your suggestion. Do you know if there is an example script with test data to test if the application is functioning on my system?