Ouranosinc / xclim

Library of derived climate variables, ie climate indicators, based on xarray.
https://xclim.readthedocs.io/en/stable/
Apache License 2.0
333 stars 59 forks source link

module 'xclim' has no attribute 'icclim' #149

Closed matteodefelice closed 5 years ago

matteodefelice commented 5 years ago

Description

I have just installed xclim with pip and I have tried to run the four lines in the Github README:

import xclim     
import xarray as xr 
ds = xr.open_dataset('myfilename.nc') 
tg = xclim.icclim.TG(ds.tas, freq='YS')

and...

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-5-82f75f519f18> in <module>
----> 1 tg = xclim.icclim.TG(ds.tas, freq='YS')

AttributeError: module 'xclim' has no attribute 'icclim'
huard commented 5 years ago

Hi Matteo,

I'm suspecting the release on PyPi to be out of date, sorry about that. Please try to install from master and give it another spin.

@tlogan2000 @Zeitsperre I think this calls for a release and upload on PyPi.

matteodefelice commented 5 years ago

You are right, unfortunately I couldn't install it from source because there is a kind of conflict with my anaconda environment during the installation of bottleneck:

AttributeError: 'dict' object has no attribute '__NUMPY_SETUP__'

then I think I will wait for the PyPI release!

tlogan2000 commented 5 years ago

For your info : For an updated pypi release we are simply waiting for an xarray pull release, with some key functionality, that we have submitted to be integrated into their master. see https://github.com/pydata/xarray/pull/2593.

We can then directly include xarray (and not our branch) in the xclim requirement for the PyPI release . It should not be too long as it is in the final stages...

Zeitsperre commented 5 years ago

@matteodefelice

@tlogan2000 is correct, we are almost ready to deploy a working version on PyPI. Once we have stable dependencies and a few more basic indices coded, we'll tag a version that automatically deploys there. The current version on PyPI is simply a parked template to keep the name.

If you are interested in trying it out now. I would make a new environment in conda (conda create -n xclim && conda activate xclim) and follow the source installation directions from there.

Zeitsperre commented 5 years ago

@matteodefelice The library now has a beta version available on PyPI. Can you try reinstalling via pip install xclim --upgrade and let us know if the problems persist?

matteodefelice commented 5 years ago

now it works! Great!