DigitalGlobe / gbdxtools

(Deprecated) Python SDK for using GBDX
MIT License
74 stars 57 forks source link

Error installing GBDx Tools in clean conda environment - Dask sharedict #788

Closed bpstewar closed 4 years ago

bpstewar commented 4 years ago

GBDXTools New Issue

Please provide some background information: Cannot import gbdxtools in clean anaconda environment

GBDX Username

bstewart@worldbank.org

GBDX Account Tier

GBDXTools Version

Run pip show gbdxtools in a terminal or !pip show gbdxtools in a Jupyter notebook cell

[ 0.16.5 ]

Python Version

Environment

Description

In a clean Anaconda environment, gbdxtools does not import

Expected behavior:

[What you expected to happen]

Actual behavior:

>>> import gbdxtools
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\WBG\Anaconda\envs\gbdx\lib\site-packages\gbdxtools\__init__.py", line 2, in <module>
    from gbdxtools.images.rda_image import RDAImage
  File "C:\WBG\Anaconda\envs\gbdx\lib\site-packages\gbdxtools\images\rda_image.py", line 3, in <module>
    from gbdxtools.images.meta import DaskMeta, GeoDaskImage
  File "C:\WBG\Anaconda\envs\gbdx\lib\site-packages\gbdxtools\images\meta.py", line 21, in <module>
    from dask import sharedict, optimization
ImportError: cannot import name 'sharedict' from 'dask' (C:\WBG\Anaconda\envs\gbdx\lib\site-packages\dask\__init__.py)
>

Example

C:\FOLDER> conda create --name gbdx
C:\FOLDER> conda activate gbdx
C:\FOLDER> conda install -c conda-forge -c digitalglobe gbdxtools
C:\FOLDER> python
>>> import gbdxtools
drwelby commented 4 years ago

Try

conda install -c conda-forge -c digitalglobe scipy=1.0.0 dask=1.1.0 gbdxtools
bpstewar commented 4 years ago

Ok, I will test some more, but I think that works. Note that I get the following two errors about deprecated library functions, but I think they both make sense

C:\WBG\Anaconda\envs\gbdx\lib\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 {}
C:\WBG\Anaconda\envs\gbdx\lib\site-packages\gbdxtools\images\meta.py:21: UserWarning: ShareDict has been deprecated in favor of HighLevelGraph and will be removed in future versions
  from dask import sharedict, optimization
drwelby commented 4 years ago

Thanks, we're working on v0.17.0 right now and that should fix all of the deprecations from older library versions.