cerfacs-globc / icclim

icclim: Python library for climate indices and climate indicators calculation.
https://icclim.readthedocs.io/en/latest/
Apache License 2.0
79 stars 32 forks source link

Icclim does not import #51

Closed mada0007 closed 2 years ago

mada0007 commented 5 years ago

Hi have installed icclim and when I conda list from terminal I see it, however, when I conda it does not appear in my envrionment when I check from pycharm and doesnt import as well. I would be glad if I can be assisted with this installation as I need it for some computations. Thanks

pagecp commented 5 years ago

Hi,

There will be a new release of icclim very soon, to fix performance and bugs, notably the one you have. I suggest that you try the latest commit of the version of icclim on github. That committed version is almost final.

Let me know if you succeed,

Christian

From: "mada0007" notifications@github.com To: "cerfacs-globc/icclim" icclim@noreply.github.com Cc: "Subscribed" subscribed@noreply.github.com Sent: Saturday, January 12, 2019 12:26:01 PM Subject: [cerfacs-globc/icclim] Icclim does not import (#51)

Hi have installed icclim and when I conda list from terminal I see it, however, when I conda it does not appear in my envrionment when I check from pycharm and doesnt import as well. I would be glad if I can be assisted with this installation as I need it for some computations. Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, [ https://github.com/cerfacs-globc/icclim/issues/51 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/AG-dytcl40tW2gIZOMEEjpnKZSEkE2lPks5vCcZJgaJpZM4Z8nRS | mute the thread ] .

mada0007 commented 5 years ago

Hi

thanks very much it is now importing from both pycharm and Jupyter.

Regards...

mada0007 commented 5 years ago

Hi christian, So after now successfully importing icclim, I decided to try it to but after defining all the variables and running the codes using the example from the documention, I get this error,

import icclim icclim.indice(user_indice=my_indice_params, in_files=file_pr, var_name='pr', slice_mode='year', base_period_time_range=bp, out_unit='days', out_file=out_f, callback=callback.defaultCallback2) Traceback (most recent call last): File "/Users/mada0007/anaconda3/envs/RAWORK/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 3267, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 1, in icclim.indice(user_indice=my_indice_params, in_files=file_pr, var_name='pr', slice_mode='year', base_period_time_range=bp, out_unit='days', out_file=out_f, callback=callback.defaultCallback2) AttributeError: module 'icclim' has no attribute 'indice' Can you please explain to me what I might be missing? Thanks in advance,

Staph

xpivan commented 5 years ago

Hi Mada,

You might want to import icclim that way: from icclim import icclim

Let me know if it works Xavier

mada0007 commented 5 years ago

Hi Xavier it still does not work. Could there be any other suggestion

xpivan commented 5 years ago

Do you still have the same error message ?

xpivan commented 5 years ago

I will try to reproduce your error with a Jupyter Notebook tomorrow - I'll let you know if I find the bug.

mada0007 commented 5 years ago

Sure thanks I will be looking forward to it.

Regards,

Mustapha

xpivan commented 5 years ago

Hi Mustapha,

I've been "successful" to get the same bug than you. I've solved by doing the following:

I think you might have icclim installed on your system but not on your anaconda envs, this was the case for me after creating the new environment. I reinstalled all the packages required to run icclim in a terminal inside the conda virtual was "activate". The module are: numpy Cython netcdftime cftime and netcdf4 from https://github.com/Unidata/netcdf4-python, just follow the instruction at the bottom of README

Then install icclim in the active anaconda environment. Once done you should be able to import icclim as follow: from icclim import icclim

Note there was one bug using anaconda, I solve it and pulled a request. Once Christian accepts the new version, clone and install it. Let me know how it goes, here is my log after doing this:

Jupyter QtConsole 4.3.1 Python 3.6.8 |Anaconda, Inc.| (default, Dec 29 2018, 19:04:46) Type 'copyright', 'credits' or 'license' for more information IPython 7.2.0 -- An enhanced Interactive Python. Type '?' for help.

from icclim import icclim

user_indice = {'indice_name': 'tas_mean', 'calc_operation': 'mean', 'var_type': 't', }

save_path = '/Users/xavier/Projets/data/test/results/'

slice_mode = 'year'

path_in_file = '/Users/xavier/Projets/data/tmpfic_CNRM_LR.nc'

out_file = save_path+"tmpfic_CNRM_LR_temporal_mean.nc"

from icclim.util import callback

icclim.indice(user_indice=user_indice, in_files=path_in_file, var_name='tasmax', ignore_Feb29th=False, out_file=out_file, callback=callback.defaultCallback2)

2019-01-29 06:10:47,463 **** 2019-01-29 06:10:47,464 2019-01-29 06:10:47,467 icclim V4.2.11 2019-01-29 06:10:47,468 2019-01-29 06:10:47,468 2019-01-29 06:10:47,469 Tue Jan 29 06:10:47 2019 GMT 2019-01-29 06:10:47,470 2019-01-29 06:10:47,471 BEGIN EXECUTION 2019-01-29 06:10:47,471 2019-01-29 06:10:47,472 **** 2019-01-29 06:10:47,821 Loading data... 2019-01-29 06:11:32,675 [Processing: ] 1.54% 2019-01-29 06:11:32,761 [Processing: ] 3.08% 2019-01-29 06:11:32,886 [Processing: ] 4.62% 2019-01-29 06:11:32,963 [Processing: ] 6.15% 2019-01-29 06:11:33,046 [Processing: ] 7.69% 2019-01-29 06:11:33,136 [Processing: ] 9.23% 2019-01-29 06:11:33,263 [Processing: ] 10.77% 2019-01-29 06:11:33,340 [Processing: ] 12.31% 2019-01-29 06:11:33,419 [Processing: ] 13.85% 2019-01-29 06:11:33,500 [Processing: ] 15.38% 2019-01-29 06:11:33,618 [Processing: ] 16.92% 2019-01-29 06:11:33,698 [Processing: ] 18.46% 2019-01-29 06:11:33,778 [Processing: ] 20.00% 2019-01-29 06:11:33,861 [Processing: ] 21.54% 2019-01-29 06:11:33,982 [Processing: ] 23.08% 2019-01-29 06:11:34,068 [Processing: ] 24.62% 2019-01-29 06:11:34,149 [Processing: ] 26.15% 2019-01-29 06:11:34,235 [Processing: ] 27.69% 2019-01-29 06:11:34,363 [Processing: ] 29.23% 2019-01-29 06:11:34,443 [Processing: ] 30.77% 2019-01-29 06:11:34,526 [Processing: ] 32.31% 2019-01-29 06:11:34,612 [Processing: ] 33.85% 2019-01-29 06:11:34,733 [Processing: ] 35.38% 2019-01-29 06:11:34,817 [Processing: ] 36.92% 2019-01-29 06:11:34,897 [Processing: ] 38.46% 2019-01-29 06:11:34,979 [Processing: ] 40.00% 2019-01-29 06:11:35,072 [Processing: ] 41.54% 2019-01-29 06:11:35,155 [Processing: ] 43.08% 2019-01-29 06:11:35,237 [Processing: ] 44.62% 2019-01-29 06:11:35,319 [Processing: ] 46.15% 2019-01-29 06:11:35,407 [Processing: ] 47.69% 2019-01-29 06:11:35,492 [Processing: ] 49.23% 2019-01-29 06:11:35,574 [Processing: ] 50.77% 2019-01-29 06:11:35,655 [Processing: ] 52.31% 2019-01-29 06:11:35,741 [Processing: ] 53.85% 2019-01-29 06:11:35,828 [Processing: ] 55.38% 2019-01-29 06:11:35,911 [Processing: ] 56.92% 2019-01-29 06:11:35,993 [Processing: ] 58.46% 2019-01-29 06:11:36,079 [Processing: ] 60.00% 2019-01-29 06:11:36,163 [Processing: ] 61.54% 2019-01-29 06:11:36,247 [Processing: ] 63.08% 2019-01-29 06:11:36,328 [Processing: ] 64.62% 2019-01-29 06:11:36,415 [Processing: ] 66.15% 2019-01-29 06:11:36,498 [Processing: ] 67.69% 2019-01-29 06:11:36,582 [Processing: ] 69.23% 2019-01-29 06:11:36,669 [Processing: ] 70.77% 2019-01-29 06:11:36,761 [Processing: ] 72.31% 2019-01-29 06:11:36,848 [Processing: ] 73.85% 2019-01-29 06:11:36,936 [Processing: ] 75.38% 2019-01-29 06:11:37,036 [Processing: ] 76.92% 2019-01-29 06:11:37,162 [Processing: ] 78.46% 2019-01-29 06:11:37,250 [Processing: ] 80.00% 2019-01-29 06:11:37,340 [Processing: ] 81.54% 2019-01-29 06:11:37,433 [Processing: ] 83.08% 2019-01-29 06:11:37,562 [Processing: ] 84.62% 2019-01-29 06:11:37,650 [Processing: ] 86.15% 2019-01-29 06:11:37,737 [Processing: ] 87.69% 2019-01-29 06:11:37,829 [Processing: ] 89.23% 2019-01-29 06:11:37,958 [Processing: ] 90.77% 2019-01-29 06:11:38,048 [Processing: ] 92.31% 2019-01-29 06:11:38,137 [Processing: ] 93.85% 2019-01-29 06:11:38,236 [Processing: ] 95.38% 2019-01-29 06:11:38,370 [Processing: ] 96.92% 2019-01-29 06:11:38,463 [Processing: ] 98.46% 2019-01-29 06:11:38,553 [Processing: ] 100.00% 2019-01-29 06:11:38,622 **** 2019-01-29 06:11:38,623 2019-01-29 06:11:38,626 icclim V4.2.11 2019-01-29 06:11:38,627 2019-01-29 06:11:38,627 2019-01-29 06:11:38,628 Tue Jan 29 06:11:38 2019 GMT 2019-01-29 06:11:38,628 2019-01-29 06:11:38,629 END EXECUTION 2019-01-29 06:11:38,629 2019-01-29 06:11:38,630 CP SECS = 38.450 2019-01-29 06:11:38,632 2019-01-29 06:11:38,632 **** Out[9]: '/Users/xavier/Projets/data/test/results/tmpfic_CNRM_LR_temporal_mean.nc'

mada0007 commented 5 years ago

Hi I dont know where the problem is actually emanating from as I still have this error when I try from icclim import icclim

ModuleNotFoundError Traceback (most recent call last)

in ----> 1 from icclim import icclim ~/anaconda3/envs/RAWORK/lib/python3.6/site-packages/icclim-4.2.9-py3.6.egg/icclim/icclim.py in 19 from netCDF4 import Dataset, MFDataset 20 ---> 21 import set_globattr 22 import set_longname_units 23 import set_longname_units_custom_indices ModuleNotFoundError: No module named 'set_globattr'
xpivan commented 5 years ago

Ok but you must re-install icclim. The package you have is icclim-4.2.9-py3.6.egg, this is a very old version of icclim. The current version is 4.2.11 not 4.2.9. Please follow the step I told you in my previous message and it should work.

mada0007 commented 5 years ago

Hi when I do conda list I have both 4.2.11 and 4.2.9 Name Version Build Channel _r-mutex 1.0.0 anacondar_1
alabaster 0.7.12 appdirs 1.4.3 py36h28b3542_0
appnope 0.1.0 py36hf537a9a_0
asn1crypto 0.24.0 py36_0
autovizwidget 0.12.6 py36_0
Babel 2.6.0 backcall 0.1.0 py36_0
blas 1.0 mkl
blaze 0.11.3 py36_0
bleach 3.0.2 py36_0
blosc 1.14.4 hd9629dc_0
bokeh 0.13.0 py36_0
bwidget 1.9.11 1
bzip2 1.0.6 h1de35cc_5
ca-certificates 2018.12.5 0 anaconda cairo 1.14.12 hc4e6be7_4
cartopy 0.17.0 py36h707127b_1000 conda-forge cctools 895 1
cdo 1.9.5 h249571a_5 conda-forge certifi 2018.11.29 py36_0 anaconda cf_units 2.0.1 py36h7eb728f_2 conda-forge cffi 1.11.5 py36h6174b99_1
cftime 1.0.2.1 py36h1d22016_0
chardet 3.0.4 py36_1
clang 4.0.1 1
clang_osx-64 4.0.1 h1ce6c1d_11
clangxx 4.0.1 1
clangxx_osx-64 4.0.1 h22b1bf0_11
click 7.0 py36_0
click-plugins 1.0.4 py36_0
cligj 0.5.0 py36_0
cloudpickle 0.6.1 py36_0
cmocean 2.0 py_0 conda-forge colorbrewer 0.2 py_0 bioconda colorcet 1.0.0 py36_0
compiler-rt 4.0.1 hcfea43d_1
cryptography 2.3.1 py36hdbc3d79_1000 conda-forge cryptography-vectors 2.3.1 py36_1000 conda-forge curl 7.61.0 h93b3f91_2 conda-forge cycler 0.10.0 py36hfc81398_0
cython 0.29.2 py36h0a44026_0 anaconda cytoolz 0.9.0.1 py36h1de35cc_1
dask 1.0.0 py36_0
dask-core 1.0.0 py36_0
datashape 0.5.4 py36_1
decorator 4.3.0 py36_0
deprecation 2.0.5 py_0 conda-forge dill 0.2.8.2 distributed 1.25.0 py36_0
docrep 0.2.5 py_0 conda-forge docrep 0.2.5 docutils 0.14 eccodes 2.8.2 ha8b302a_0 conda-forge EMD-signal 0.2.6 entrypoints 0.2.3 py36_2
et-xmlfile 1.0.1 expat 2.2.6 h0a44026_0
fastnumbers 2.1.1 fftw 3.3.8 h470a237_1 conda-forge flask 1.0.2 py36_1
flask-cors 3.0.7 py36_0
fontconfig 2.13.0 h5d5b041_1
freetype 2.9.1 hb4e5f40_0
freexl 1.0.5 h1de35cc_0
fribidi 1.0.5 h1de35cc_0
funcargparse 0.2.0 py_1 conda-forge future 0.17.1 py36_0 anaconda gdal 2.3.1 py36hb00a9d7_4 conda-forge geos 3.6.2 h5470d99_2
geotiff 1.4.2 h2e810ce_1005 conda-forge gettext 0.19.8.1 h15daf44_3
gfortran_osx-64 4.8.5 h22b1bf0_5
giflib 5.1.4 h1de35cc_1
glib 2.56.2 hd9629dc_0
graphite2 1.3.12 h7d4d677_1 conda-forge gsl 2.2.1 h002c638_3
h5py 2.8.0 py36h878fce3_3
harfbuzz 1.9.0 h04dbb29_1 conda-forge hdf4 4.2.13 hf3c6af0_1002 conda-forge/label/gcc7 hdf5 1.10.2 hfa1e0ec_1
hdijupyterutils 0.12.6 py36_0
heapdict 1.0.0 py36_2
icclim 4.2.11 icclim 4.2.9 icu 58.2 h4b95b61_1
idna 2.7 py36_0
imageio 2.4.1 py36_0
imagesize 1.1.0 intake 0.2.6 py_17 intake/label/dev intel-openmp 2019.1 144
ipykernel 5.1.0 py36h39e3cac_0
ipython 7.2.0 py36h39e3cac_0
ipython_genutils 0.2.0 py36h241746c_0
ipywidgets 7.4.2 py36_0
itsdangerous 1.1.0 py36_0
jasper 1.900.1 hff1ad4c_5 conda-forge jdcal 1.4 jedi 0.13.1 py36_0
jinja2 2.10 py36_0
jpeg 9c h1de35cc_1001 conda-forge/label/gcc7 json-c 0.12.1 h470a237_1 conda-forge jsonschema 2.6.0 py36hb385e00_0
jupyter 1.0.0 py36_7
jupyter_client 5.2.3 py36_0
jupyter_console 6.0.0 py36_0
jupyter_core 4.4.0 py36_0
jupyterlab 0.35.4 py36_0 conda-forge jupyterlab_server 0.2.0 py_0 conda-forge kealib 1.4.9 h0bee7d0_2 conda-forge kiwisolver 1.0.1 py36h0a44026_0
krb5 1.14.6 0 conda-forge ld64 274.2 1
libboost 1.67.0 hebc422b_4
libcurl 7.61.1 hf30b1f0_0
libcxx 4.0.1 hcfea43d_1
libcxxabi 4.0.1 hcfea43d_1
libdap4 3.19.1 h3d3e54a_0
libedit 3.1.20170329 hb402a30_2
libffi 3.2.1 h475c297_4
libgdal 2.3.1 h1b61fa7_4 conda-forge libgfortran 3.0.1 h93005f0_2
libiconv 1.15 hdd342a3_7
libkml 1.3.0 hbe12b63_4
libnetcdf 4.6.1 h4e6abe9_2
libpng 1.6.35 ha441bb4_0
libpq 9.5.4 0
libsodium 1.0.16 h3efe00b_0
libspatialindex 1.8.5 h2c08c6b_2
libspatialite 4.3.0a hf0dd066_1023 conda-forge libssh2 1.8.0 hf30b1f0_1003 conda-forge libtiff 4.0.9 hcb84e12_2
libuuid 1.0.3 h6bb4b03_2
libxml2 2.9.8 hab757c2_1
libxslt 1.1.32 hb819dd2_0
llvm 4.0.1 1
llvm-lto-tapi 4.0.1 1
llvm-openmp 4.0.1 hcfea43d_1
llvmlite 0.26.0 py36h8c7ce04_0
locket 0.2.0 py36hca03003_1
lxml 4.2.5 py36hef8c89e_0
lzo 2.10 h362108e_2
make 4.2.1 h470a237_2 conda-forge markupsafe 1.1.0 py36h1de35cc_0
matplotlib 3.0.2 py36h54f8f79_0
meteogram-py 0.0.1 mistune 0.8.4 py36h1de35cc_0
mkl 2018.0.3 1
mkl_fft 1.0.6 py36hb8a8100_0
mkl_random 1.0.1 py36h5d10147_1
mlab 1.1.4 more-itertools 5.0.0 py36_0
msgpack-numpy 0.4.4.2 py36_0
msgpack-python 0.5.6 py36h04f5b5a_1
multipledispatch 0.6.0 py36_0
multiprocess 0.70.6.1 munch 2.3.2 py36_0
nbconvert 5.3.1 py36_0
nbformat 4.4.0 py36h827af21_0
ncurses 6.1 h0a44026_1
netcdf4 1.4.1 py36ha292673_200 conda-forge netCDF4 1.4.2 netcdftime 1.0.0a2 py36_0 conda-forge networkx 2.2 py36_1
notebook 5.7.2 py36_0
numba 0.41.0 py36h6440ff4_0
numexpr 2.6.8 py36h1dc9127_0
numpy 1.15.4 py36h6a91979_0
numpy-base 1.15.4 py36h8a80b8c_0
numpydoc 0.8.0 odo 0.5.1 py36hc1af34a_0
olefile 0.46 py36_0
openjpeg 2.3.0 hb95cd4c_1
openpyxl 2.5.12 openssl 1.0.2p h1de35cc_0 anaconda ossuuid 1.6.2 hfc679d8_0 conda-forge owslib 0.17.0 py_0 conda-forge packaging 18.0 py36_0
pandas 0.23.4 py36h6440ff4_0
pandas-datareader 0.7.0 py36_0
pandasql 0.7.3 py36_1
pandoc 2.2.3.2 0
pandocfilters 1.4.2 py36_1
pango 1.40.14 he752989_2 conda-forge param 1.6.1 py_0 ioam parso 0.3.1 py36_0
partd 0.3.9 py36_0
pathos 0.2.2.1 patsy 0.5.1 py36_0 anaconda pcre 8.42 h378b8a2_0
pexpect 4.6.0 py36_0
pickleshare 0.7.5 py36_0
pillow 5.3.0 py36hb68e598_0
pip 18.1 py36_0
pixman 0.34.0 hca0a616_3
plotly 3.4.2 py36_0 plotly poppler 0.67.0 hf4bf5f7_1002 conda-forge poppler-data 0.4.9 0
postgresql 10.5 py36h286b696_0 conda-forge pox 0.2.4 ppft 1.6.4.8 prettytable 0.7.2 proj4 4.9.3 h470a237_8 conda-forge prometheus_client 0.4.2 py36_0
prompt_toolkit 2.0.7 py36_0
psutil 5.4.8 py36h1de35cc_0
psy-maps 1.2.0 py36_1000 conda-forge psy-simple 1.2.0 py36_1000 conda-forge psycopg2 2.6.2 py36_0
psyplot 1.2.0 py36_1000 conda-forge ptyprocess 0.6.0 py36_0
pycparser 2.19 py36_0
pyct 0.4.3 py_0 pyviz pyepsg 0.4.0 py_0 conda-forge pygments 2.2.0 py36h240cd3f_0
pykdtree 1.3.1 py36h917ab60_1002 conda-forge/label/gcc7 pyke 1.1.1 py36_1000 conda-forge pyopenssl 18.0.0 py36_0
pyparsing 2.3.0 py36_0
pyproj 1.9.5.1 py36hfb6cdf6_1006 conda-forge pyqt 5.6.0 py36h8210e8a_7 conda-forge pysal 1.14.4.post1 py36_1
pyshp 1.2.12 py36_0
pysocks 1.6.8 py36_0
pytables 3.4.4 py36h13cba08_0
python 3.6.6 h4a56312_1003 conda-forge python-awips 18.1.2 py_0 conda-forge python-datamatrix 0.8.3 py_0 cogsci python-dateutil 2.7.5 py36_0
python-snappy 0.5.3 py36h0a44026_0
pytz 2018.7 py36_0
pyviz_comms 0.6.0 py36_0
pywavelets 1.0.1 py36h1d22016_0
pyyaml 3.13 py36h1de35cc_0
pyzmq 17.1.2 py36h1de35cc_0
qgrid 1.1.1 py36_1
qt 5.6.2 h9e3eb04_4 conda-forge qtconsole 4.4.2 py36_0
r-base 3.4.1 h4fe35fd_8 conda-forge r-timedate 3043.102 r341h6115d3f_0 conda-forge r-timeseries 3042.102 r3.4.1_0 conda-forge readline 7.0 h1de35cc_5
requests 2.20.1 py36_0
retrying 1.3.3 py36_2
rtree 0.8.3 py36_0
ruamel_yaml 0.15.46 py36h1de35cc_0
scikit-learn 0.20.1 py36h4f467ca_0 anaconda scilab2py 0.6.2 scipy 1.1.0 py36h28f7352_1
seaborn 0.9.0 py36_0 anaconda send2trash 1.5.0 py36_0
setuptools 40.6.2 py36_0
shapely 1.6.4 py36h20de77a_0
sip 4.18.1 py36hfc679d8_0 conda-forge six 1.11.0 py36_1
snappy 1.1.7 he62c110_3
snowballstemmer 1.2.1 sortedcontainers 2.1.0 py36_0
Sphinx 1.8.3 sphinxcontrib-websupport 1.1.0 sqlalchemy 1.2.14 py36h1de35cc_0
sqlite 3.25.3 ha441bb4_0
statsmodels 0.9.0 py36h1d22016_0 anaconda streamz 0.5.0 py36_0
tblib 1.3.2 py36hda67792_0
terminado 0.8.1 py36_1
testpath 0.4.2 py36_0
tk 8.6.8 ha441bb4_0
tktable 2.10 h1de35cc_0
toolz 0.9.0 py36_0
tornado 5.1.1 py36h1de35cc_0
traitlets 4.3.2 py36h65bd3ce_0
udunits2 2.2.27.6 h3a4f0e9_1 conda-forge urllib3 1.23 py36_0
wcwidth 0.1.7 py36h8c6ec74_0
webencodings 0.5.1 py36_1
werkzeug 0.14.1 py36_0
wheel 0.32.3 py36_0
widgetsnbextension 3.4.2 py36_0
wradlib 1.2.1 py_0 conda-forge wrapt 1.10.11 py36h1de35cc_2
xarray 0.11.0 py36_0
xerces-c 3.2.0 h5d6a6da_2 conda-forge xmltodict 0.11.0 py_1 conda-forge xrft 0.1 py_1 conda-forge/label/gcc7 xscale 0.1.dev0+34.g287f044 xz 5.2.4 h1de35cc_4
yaml 0.1.7 hc338f04_2
zeromq 4.2.5 h0a44026_1
zict 0.1.3 py36_0
zlib 1.2.11 h1de35cc_3

Then when I try to uninstall icclim then I have this error 4 mada0007$ pip uninstall icclim Uninstalling icclim-4.2.11: Would remove: /Users/mada0007/anaconda3/envs/RAWORK/lib/python3.6/site-packages/icclim-4.2.11-py3.6.egg Proceed (y/n)? y Exception: Traceback (most recent call last): File "/Users/mada0007/anaconda3/envs/RAWORK/lib/python3.6/shutil.py", line 544, in move os.rename(src, real_dst) PermissionError: [Errno 13] Permission denied: '/Users/mada0007/anaconda3/envs/RAWORK/lib/python3.6/site-packages/icclim-4.2.11-py3.6.egg' -> '/private/var/folders/zc/2qc8w1256mb4wptmk709j1y1xh_xj3/T/pip-uninstall-14g5bykm/Users/mada0007/anaconda3/envs/RAWORK/lib/python3.6/site-packages/icclim-4.2.11-py3.6.egg'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/mada0007/anaconda3/envs/RAWORK/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 143, in main status = self.run(options, args) File "/Users/mada0007/anaconda3/envs/RAWORK/lib/python3.6/site-packages/pip/_internal/commands/uninstall.py", line 75, in run auto_confirm=options.yes, verbose=self.verbosity > 0, File "/Users/mada0007/anaconda3/envs/RAWORK/lib/python3.6/site-packages/pip/_internal/req/req_install.py", line 683, in uninstall uninstalled_pathset.remove(auto_confirm, verbose) File "/Users/mada0007/anaconda3/envs/RAWORK/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.py", line 224, in remove renames(path, new_path) File "/Users/mada0007/anaconda3/envs/RAWORK/lib/python3.6/site-packages/pip/_internal/utils/misc.py", line 280, in renames shutil.move(old, new) File "/Users/mada0007/anaconda3/envs/RAWORK/lib/python3.6/shutil.py", line 556, in move rmtree(src) File "/Users/mada0007/anaconda3/envs/RAWORK/lib/python3.6/shutil.py", line 494, in rmtree return _rmtree_unsafe(path, onerror) File "/Users/mada0007/anaconda3/envs/RAWORK/lib/python3.6/shutil.py", line 384, in _rmtree_unsafe _rmtree_unsafe(fullname, onerror) File "/Users/mada0007/anaconda3/envs/RAWORK/lib/python3.6/shutil.py", line 389, in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) File "/Users/mada0007/anaconda3/envs/RAWORK/lib/python3.6/shutil.py", line 387, in _rmtree_unsafe os.unlink(fullname) PermissionError: [Errno 13] Permission denied: '/Users/mada0007/anaconda3/envs/RAWORK/lib/python3.6/site-packages/icclim-4.2.11-py3.6.egg/EGG-INFO/PKG-INFO' (RAWORK) MU00152044X:icclim-4.2.12 4 mada0007$ Any suggetions how to remove this?

mada0007 commented 5 years ago

Hello everyone please I am still getting this error even though I have done everything again


ModuleNotFoundError Traceback (most recent call last)

in ----> 1 from icclim import icclim ~/anaconda3/lib/python3.6/site-packages/icclim-4.2.11-py3.6.egg/icclim/icclim.py in 19 from netCDF4 import Dataset, MFDataset 20 ---> 21 import set_globattr 22 import set_longname_units 23 import set_longname_units_custom_indices ModuleNotFoundError: No module named 'set_globattr' any help will be much appreciated thanks
mada0007 commented 5 years ago

and from ipython i get this error [3]: from icclim import icclim

ModuleNotFoundError Traceback (most recent call last)

in ----> 1 from icclim import icclim ~/Downloads/icclim-4.2.13/icclim/icclim.py in 47 from . import set_longname_units 48 from . import set_longname_units_custom_indices ---> 49 from . import calc_percentiles 50 from . import time_subset 51 from . import maps ~/Downloads/icclim-4.2.13/icclim/calc_percentiles.py in 13 import pdb 14 import calendar ---> 15 from .util import calc 16 from .util import util_dt 17 import netcdftime ~/Downloads/icclim-4.2.13/icclim/util/calc.py in 11 import pdb 12 import sys ---> 13 from . import util_dt 14 from collections import OrderedDict 15 ~/Downloads/icclim-4.2.13/icclim/util/util_dt.py in 5 6 #from cftime import num2date, date2num ----> 7 import netcdftime 8 import pdb 9 import os ModuleNotFoundError: No module named 'netcdftime'
xpivan commented 5 years ago

Hi Mada,

You must install netcdftime: pip install netcdftime

mada0007 commented 5 years ago

Thanks only that when I use pip install netcdftime it takes forever solving environment and never installs, However I will still try and see how it goes Thanks

xpivan commented 5 years ago

maybe try sudo pip install netcdftime

Or another suggestion: pip install --upgrade pip

You may have to write the command just below with sudo at the beggining

Hope it will help

mada0007 commented 5 years ago

Hi all finally after creating new env and install necdftime first icclim is working except that is producing empty netcdf files using this code for example

icclim.indice(user_indice=my_indice_params, in_files='/Users/mada0007/Documents/RAWORK/Data_files/pr_Amon_ACCESS1-0_amip_r1i1p1_197901-200812.nc', var_name='pr',\ slice_mode='year', base_period_time_range=tr,\ out_unit='days', out_file=out_f,callback=callback.defaultCallback2) 2019-02-22 06:31:37,297 **** 2019-02-22 06:31:37,297 2019-02-22 06:31:37,298 icclim V4.2.13 2019-02-22 06:31:37,298 2019-02-22 06:31:37,298 2019-02-22 06:31:37,298 Fri Feb 22 06:31:37 2019 GMT 2019-02-22 06:31:37,298 2019-02-22 06:31:37,298 BEGIN EXECUTION 2019-02-22 06:31:37,299 2019-02-22 06:31:37,299 **** 2019-02-22 06:31:37,343 Loading data... 2019-02-22 06:31:38,401 [Processing: ] 3.33% 2019-02-22 06:31:38,505 [Processing: ] 6.67% 2019-02-22 06:31:38,614 [Processing: ] 10.00% 2019-02-22 06:31:38,720 [Processing: ] 13.33% 2019-02-22 06:31:38,822 [Processing: ] 16.67% 2019-02-22 06:31:38,925 [Processing: ] 20.00% 2019-02-22 06:31:39,023 [Processing: ] 23.33% 2019-02-22 06:31:39,123 [Processing: ] 26.67% 2019-02-22 06:31:39,223 [Processing: ] 30.00% 2019-02-22 06:31:39,311 [Processing: ] 33.33% 2019-02-22 06:31:39,396 [Processing: ] 36.67% 2019-02-22 06:31:39,481 [Processing: ] 40.00% 2019-02-22 06:31:39,569 [Processing: ] 43.33% 2019-02-22 06:31:39,664 [Processing: ] 46.67% 2019-02-22 06:31:39,753 [Processing: ] 50.00% 2019-02-22 06:31:39,843 [Processing: ] 53.33% 2019-02-22 06:31:39,929 [Processing: ] 56.67% 2019-02-22 06:31:40,015 [Processing: ] 60.00% 2019-02-22 06:31:40,102 [Processing: ] 63.33% 2019-02-22 06:31:40,189 [Processing: ] 66.67% 2019-02-22 06:31:40,272 [Processing: ] 70.00% 2019-02-22 06:31:40,359 [Processing: ] 73.33% 2019-02-22 06:31:40,443 [Processing: ] 76.67% 2019-02-22 06:31:40,529 [Processing: ] 80.00% 2019-02-22 06:31:40,615 [Processing: ] 83.33% 2019-02-22 06:31:40,701 [Processing: ] 86.67% 2019-02-22 06:31:40,788 [Processing: ] 90.00% 2019-02-22 06:31:40,796 [Processing: ] 93.33% 2019-02-22 06:31:40,802 [Processing: ] 96.67% 2019-02-22 06:31:40,810 [Processing: ] 100.00% 2019-02-22 06:31:40,836 **** 2019-02-22 06:31:40,837 2019-02-22 06:31:40,837 icclim V4.2.13 2019-02-22 06:31:40,837 2019-02-22 06:31:40,837 2019-02-22 06:31:40,837 Fri Feb 22 06:31:40 2019 GMT 2019-02-22 06:31:40,837 2019-02-22 06:31:40,837 END EXECUTION 2019-02-22 06:31:40,837 2019-02-22 06:31:40,837 CP SECS = 11.272 2019-02-22 06:31:40,837 2019-02-22 06:31:40,837 ****

and when I try to open dset = xr.open_dataset('test.nc') dset

Dimensions: () size of nc file is 47bytes what am I missing
mada0007 commented 5 years ago

FYI my data is monthly data though

pagecp commented 3 years ago

I could not reproduce the bug. Can you try the latest 4.2.16 release?

bzah commented 2 years ago

Icclim installation has been reworked. With version 5.0.0 pip install icclim is now available and conda install will be coming soon. Thus I'm closing this issue as it seems it is only relevant for icclim 4.x.x.

Feel free to reopen or create a new one if the issue persists in 5.0.0.