AttributeError: module 'dask' has no attribute 'config'

467 views
Skip to first unread message

sjtuzh...@gmail.com

unread,
Oct 9, 2019, 11:26:27 PM10/9/19
to pycalphad
Dear all,

I've installed pycalphad using conda, but when I do run_test.py, I got:

python run_test.py 

import: 'pycalphad'

Traceback (most recent call last):

  File "run_test.py", line 2, in <module>

    import pycalphad

  File "/Users/leizhang/miniconda3/lib/python3.6/site-packages/pycalphad/__init__.py", line 32, in <module>

    from pycalphad.core.calculate import calculate

  File "/Users/leizhang/miniconda3/lib/python3.6/site-packages/pycalphad/core/calculate.py", line 21, in <module>

    from xarray import Dataset, concat

  File "/Users/leizhang/miniconda3/lib/python3.6/site-packages/xarray/__init__.py", line 21, in <module>

    from .backends.api import (

  File "/Users/leizhang/miniconda3/lib/python3.6/site-packages/xarray/backends/__init__.py", line 6, in <module>

    from .cfgrib_ import CfGribDataStore

  File "/Users/leizhang/miniconda3/lib/python3.6/site-packages/xarray/backends/cfgrib_.py", line 7, in <module>

    from .locks import SerializableLock, ensure_lock

  File "/Users/leizhang/miniconda3/lib/python3.6/site-packages/xarray/backends/locks.py", line 13, in <module>

    from dask.distributed import Lock as DistributedLock

  File "/Users/leizhang/miniconda3/lib/python3.6/site-packages/dask/distributed.py", line 5, in <module>

    from distributed import *

  File "/Users/leizhang/miniconda3/lib/python3.6/site-packages/distributed/__init__.py", line 1, in <module>

    from . import config

  File "/Users/leizhang/miniconda3/lib/python3.6/site-packages/distributed/config.py", line 11, in <module>

    config = dask.config.config

AttributeError: module 'dask' has no attribute 'config'


Brandon Bocklund

unread,
Oct 10, 2019, 10:20:19 AM10/10/19
to pycalphad
Which versions of pycalphad, dask, distributed and xarray do you have?

You can check the versions with the
conda list

command.

Lei Zhang

unread,
Oct 10, 2019, 10:51:30 AM10/10/19
to Brandon Bocklund, pycalphad

dask                      2.1.0                      py_0  

dask-core                 2.1.0                      py_0 distributed               2.1.0                      

distributed               2.1.0                      py_0  

pycalphad                 0.7.1.post2     py37h1de35cc_1000    conda-forge

xarray                    0.13.0                     py_0    conda-forge


--
You received this message because you are subscribed to a topic in the Google Groups "pycalphad" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pycalphad/BhLBdH4ypYg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pycalphad+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pycalphad/17521a5a-b253-4df7-a5cc-57d0e5dbd02e%40googlegroups.com.


--
Lei Zhang
Ph.D. candidate
Center for Innovative Fuel Cell and Battery Technologies
School of Materials Science and Engineering
Georgia Institute of Technology
Google Scholar

Brandon Bocklund

unread,
Oct 10, 2019, 1:16:54 PM10/10/19
to pycalphad
Hmm. I'm not able to reproduce this with the following on macOS with Python 3.7


dask                      2.1.0                      py_0    conda-forge
dask-core                 2.1.0                      py_0    conda-forge
distributed               2.1.0                      py_0    conda-forge
pycalphad                 0.7.1.post2     py37h1de35cc_1000    conda-forge
xarray                    0.13.0                     py_0    conda-forge

Based on the traceback, it looks like it might be an xarray issue. Can you run the following successfully?

from xarray import Dataset, concat

Also, is it possible that you ran conda list from inside an environment with a different set of packages than the ones called by the base environment of Anaconda that you supplied in your traceback? 

Lei Zhang

unread,
Oct 10, 2019, 1:54:25 PM10/10/19
to Brandon Bocklund, pycalphad
Hi, Bradon,

I got this:

python

Python 3.6.7 | packaged by conda-forge | (default, Feb 28 2019, 02:16:08) 

[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> from xarray import Dataset, concat

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

  File "/Users/leizhang/miniconda3/lib/python3.6/site-packages/xarray/__init__.py", line 21, in <module>

    from .backends.api import (

  File "/Users/leizhang/miniconda3/lib/python3.6/site-packages/xarray/backends/__init__.py", line 6, in <module>

    from .cfgrib_ import CfGribDataStore

  File "/Users/leizhang/miniconda3/lib/python3.6/site-packages/xarray/backends/cfgrib_.py", line 7, in <module>

    from .locks import SerializableLock, ensure_lock

  File "/Users/leizhang/miniconda3/lib/python3.6/site-packages/xarray/backends/locks.py", line 13, in <module>

    from dask.distributed import Lock as DistributedLock

  File "/Users/leizhang/miniconda3/lib/python3.6/site-packages/dask/distributed.py", line 5, in <module>

    from distributed import *

  File "/Users/leizhang/miniconda3/lib/python3.6/site-packages/distributed/__init__.py", line 1, in <module>

    from . import config

  File "/Users/leizhang/miniconda3/lib/python3.6/site-packages/distributed/config.py", line 11, in <module>

    config = dask.config.config

AttributeError: module 'dask' has no attribute 'config'

--
You received this message because you are subscribed to a topic in the Google Groups "pycalphad" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pycalphad/BhLBdH4ypYg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pycalphad+...@googlegroups.com.

Brandon Bocklund

unread,
Oct 11, 2019, 10:02:19 AM10/11/19
to pycalphad
Yeah, it looks like an upstream issue at xarray. You can file an issue on the xarray GitHub: https://github.com/pydata/xarray/issues

In the meantime, you might be able to find success if you downgrade dask, dask-core, and distributed to a version less than 2, i.e.

conda install "dask<2" "distributed<2"


Lei Zhang

unread,
Oct 11, 2019, 11:06:41 AM10/11/19
to Brandon Bocklund, pycalphad
Thank you, Brandon,

Now I get this by running python run_test.py:

(base) Leis-Air-3:test leizhang$ python run_test.py 

import: 'pycalphad'

/Users/leizhang/anaconda3/lib/python3.7/site-packages/dask/config.py:168: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.

  data = yaml.load(f.read()) or {}

import: 'pycalphad.core'

import: 'pycalphad.io'

import: 'pycalphad.plot'


I guess it means OK now.

Best,

--
You received this message because you are subscribed to a topic in the Google Groups "pycalphad" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pycalphad/BhLBdH4ypYg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pycalphad+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages