Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import error #44

Closed
fipoucat opened this issue Apr 28, 2024 · 2 comments
Closed

import error #44

fipoucat opened this issue Apr 28, 2024 · 2 comments

Comments

@fipoucat
Copy link

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
Copy link

rabbanidu93 commented May 15, 2024

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 xcast_env -c conda-forge -c hallkjc01 xcast xarray scipy=1.11.4 netcdf4 jupyter ipykernel

@fipoucat
Copy link
Author

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants