pangeo-data / pangeo

Pangeo website + discussion of general issues related to the project.
http://pangeo.io
703 stars 189 forks source link

package xgcm not able to import #785

Closed qyxiao closed 4 years ago

qyxiao commented 4 years ago

I wonder if the package xgcm has been updated lately? Today when I tried to use it an error pop up: "AttributeError: 'NoneType' object has no attribute 'expandtabs'

The full error message is: AttributeError Traceback (most recent call last)

in ----> 1 import xgcm /srv/conda/envs/notebook/lib/python3.7/site-packages/xgcm/__init__.py in 4 del get_versions 5 ----> 6 from .grid import Grid, Axis 7 from .autogenerate import generate_grid_ds /srv/conda/envs/notebook/lib/python3.7/site-packages/xgcm/grid.py in 757 758 --> 759 class Grid: 760 """ 761 An object with multiple :class:`xgcm.Axis` objects representing different /srv/conda/envs/notebook/lib/python3.7/site-packages/xgcm/grid.py in Grid() 1065 return out 1066 -> 1067 @docstrings.dedent 1068 def _apply_vector_function(self, function, vector, **kwargs): 1069 # the keys, should be axis names /srv/conda/envs/notebook/lib/python3.7/site-packages/docrep/decorators.py in update_docstring(self, *args, **kwargs) 24 return func(self, *args, **kwargs) 25 elif len(args) and callable(args[0]): ---> 26 doc = func(self, args[0].__doc__, *args[1:], **kwargs) 27 _set_object_doc(args[0], doc, py2_class=self.python2_classes) 28 return args[0] /srv/conda/envs/notebook/lib/python3.7/site-packages/docrep/__init__.py in dedent(self, s, stacklevel) 515 encountering an invalid key in the string 516 """ --> 517 s = inspect.cleandoc(s) 518 return safe_modulo(s, self.params, stacklevel=stacklevel) 519 /srv/conda/envs/notebook/lib/python3.7/inspect.py in cleandoc(doc) 617 onwards is removed.""" 618 try: --> 619 lines = doc.expandtabs().split('\n') 620 except UnicodeError: 621 return None AttributeError: 'NoneType' object has no attribute 'expandtabs'
jbusecke commented 4 years ago

Dear @qyxiao, this is a problem with the docrep dependency (see xgcm/210. Can you try downgrading docrep to a version smaller than 0.3?

If the problem persists please feel free to reach out again (preferably as an xgcm issue, I monitor these much closer than pangeo).

qyxiao commented 4 years ago

Hi @jbusecke, thank you very much for your reply. I have a dump question though. After I create a new environment, how can I open a new notebook under this environment in Pangeo? If I don't use a new environment and just type: conda install dorep=0.2.7 then a message like this will pop up and I'm not sure if I should proceed... " The environment is inconsistent, please check the package plan carefully The following packages are causing the inconsistency:

dhruvbalwada commented 4 years ago

This is a problem when trying to use the pangeo default environment. Somehow xgcm's version has gone out of sync with the other modules installed.

Maybe someone from the pangeo team can look into this?

PS - you can have your custom environment modifications by using the suggestion here: https://discourse.pangeo.io/t/suggestions-for-additional-modules/765/5

rabernat commented 4 years ago

It's a big problem that this is broken in Pangeo Cloud. @jbusecke, could you work with @TomAugspurger to try to fix this problem? This will be a good opportunity for you to learn how the Pangeo Cloud environments are configured.

TomAugspurger commented 4 years ago

The best fix is to probably update https://github.com/pangeo-data/pangeo-docker-images/blob/8bbb9ea0f5467d7aeb324343ed229be45a9d0e6a/pangeo-notebook/environment.yml#L73 to the fixed version of xgcm.

Then we can tag a release of the docker images to rebuild those. Bots should pick up from there and we'll get it deployed to prod.

On Tue, Sep 22, 2020 at 3:40 PM Ryan Abernathey notifications@github.com wrote:

It's a big problem that this is broken in Pangeo Cloud. @jbusecke https://github.com/jbusecke, could you work with @TomAugspurger https://github.com/TomAugspurger to try to fix this problem? This will be a good opportunity for you to learn how the Pangeo Cloud environments are configured.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pangeo-data/pangeo/issues/785#issuecomment-696967323, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKAOISXZTEG3WQZFW7FBP3SHEDTXANCNFSM4RR4NESQ .

jbusecke commented 4 years ago

@TomAugspurger , we have released v0.4.0 a while ago (which includes a pin to an earlier docrep version), can we just retrigger the build? Or do you need me to pin the precise version of xgcm?

jbusecke commented 4 years ago

This is now fixed for me. @qyxiao could you try it and close the issue if it's fixed for you aswell?

Thanks for the help in resolving this quickly @TomAugspurger .

qyxiao commented 4 years ago

Hi @jbusecke, yes it is working now. Thank you all!