Pymc3: error on import pymc3: AttributeError: module 'xarray.core.formatting_html' has no attribute 'CSS_STYLE'

Created on 22 Sep 2020  路  5Comments  路  Source: pymc-devs/pymc3

Description of your problem

import pymc3 gives the error: AttributeError: module 'xarray.core.formatting_html' has no attribute 'CSS_STYLE'.

Please provide a minimal, self-contained, and reproducible example.

import pymc3

Please provide the full traceback.

WARNING (theano.configdefaults): g++ not available, if using conda: `conda install m2w64-toolchain`
C:\Python37\lib\site-packages\theano\configdefaults.py:560: UserWarning: DeprecationWarning: there is no c++ compiler.This is deprecated and with Theano 0.11 a c++ compiler will be mandatory
  warnings.warn("DeprecationWarning: there is no c++ compiler."
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python37\lib\site-packages\pymc3\__init__.py", line 41, in <module>
    from .distributions import *
  File "C:\Python37\lib\site-packages\pymc3\distributions\__init__.py", line 15, in <module>
    from . import timeseries
  File "C:\Python37\lib\site-packages\pymc3\distributions\timeseries.py", line 22, in <module>
    from pymc3.util import get_variable_name
  File "C:\Python37\lib\site-packages\pymc3\util.py", line 20, in <module>
    import arviz
  File "C:\Python37\lib\site-packages\arviz\__init__.py", line 28, in <module>
    from .data import *
  File "C:\Python37\lib\site-packages\arviz\data\__init__.py", line 2, in <module>
    from .inference_data import InferenceData, concat
  File "C:\Python37\lib\site-packages\arviz\data\inference_data.py", line 15, in <module>
    from ..utils import _subset_list, HtmlTemplate
  File "C:\Python37\lib\site-packages\arviz\utils.py", line 670, in <module>
    class HtmlTemplate:
  File "C:\Python37\lib\site-packages\arviz\utils.py", line 696, in HtmlTemplate
    css_template = f"<style> {xr.core.formatting_html.CSS_STYLE}{specific_style} </style>"
AttributeError: module 'xarray.core.formatting_html' has no attribute 'CSS_STYLE'
>>>

Please provide any additional information below.

Versions and main components

  • PyMC3 Version: 3.9.3
  • Theano Version: 1.0.5
  • Python Version: 3.7.7
  • Operating system: Windows 10
  • How did you install PyMC3: pip

Most helpful comment

xarray have had a new release https://pypi.org/project/xarray/#history , looks like they removed this attribute.

For now, I'd say do

pip uninstall pymc3
pip install xarray==0.16.0
pip install pymc3

All 5 comments

Thanks @alessandro-gentilini for the report, I'm getting this too when installing from pip on Windows

@MarcoGorelli I would say the WARNINGs are not an issue...

xarray have had a new release https://pypi.org/project/xarray/#history , looks like they removed this attribute.

For now, I'd say do

pip uninstall pymc3
pip install xarray==0.16.0
pip install pymc3

Looks like this has been fixed in arviz https://github.com/arviz-devs/arviz/pull/1389

linking related ArviZ ticket https://github.com/arviz-devs/arviz/issues/1393

closing this because the issue was in ArviZ and is already fixed there. I'll ping them to do a new release though.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jonathanhfriedman picture jonathanhfriedman  路  6Comments

yarlett picture yarlett  路  5Comments

michaelosthege picture michaelosthege  路  5Comments

ricardoV94 picture ricardoV94  路  3Comments

aakhmetz picture aakhmetz  路  4Comments