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 arviz throws an error in dependency "xarray" #1393

Closed
aramakus opened this issue Sep 23, 2020 · 2 comments
Closed

import arviz throws an error in dependency "xarray" #1393

aramakus opened this issue Sep 23, 2020 · 2 comments

Comments

@aramakus
Copy link

After installing arviz on Ubuntu 18.04 using either pip or conda an error is thrown in an attempt to import arviz:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-4-980441a934be> in <module>
----> 1 import arviz
      2 
      3 #az.plot_trace(mcmc.get_samples(), filter_vars="like")

~/anaconda3/envs/jax/lib/python3.8/site-packages/arviz/__init__.py in <module>
     26 
     27 from .rcparams import rcParams, rc_context
---> 28 from .data import *
     29 from .stats import *
     30 from .plots import *

~/anaconda3/envs/jax/lib/python3.8/site-packages/arviz/data/__init__.py in <module>
      1 """Code for loading and manipulating data structures."""
----> 2 from .inference_data import InferenceData, concat
      3 from .io_netcdf import from_netcdf, to_netcdf
      4 from .datasets import load_arviz_data, list_datasets, clear_data_home
      5 from .base import numpy_to_data_array, dict_to_dataset, CoordSpec, DimSpec

~/anaconda3/envs/jax/lib/python3.8/site-packages/arviz/data/inference_data.py in <module>
     13 from xarray.core.options import OPTIONS
     14 
---> 15 from ..utils import _subset_list, HtmlTemplate
     16 from ..rcparams import rcParams
     17 

~/anaconda3/envs/jax/lib/python3.8/site-packages/arviz/utils.py in <module>
    668 
    669 
--> 670 class HtmlTemplate:
    671     """Contain html templates for InferenceData repr."""
    672 

~/anaconda3/envs/jax/lib/python3.8/site-packages/arviz/utils.py in HtmlTemplate()
    694             """
    695     specific_style = ".xr-wrap{width:700px!important;}"
--> 696     css_template = f"<style> {xr.core.formatting_html.CSS_STYLE}{specific_style} </style>"

AttributeError: module 'xarray.core.formatting_html' has no attribute 'CSS_STYLE'

xarray is installed with arviz as a dependency, so my system did not have any other version of the package.

@aramakus
Copy link
Author

UPDATE : latest version, available on Github works fine.

@michaelosthege
Copy link
Contributor

linking the related PR #1389 that fixed this on master (for now)

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

3 participants