Repository navigation
Closed
Description
In dask's setup.py there is no minimum version specified for numpy.
13 'dataframe': ['numpy', 'pandas >= 0.19.0', 'toolz >= 0.7.3',
14 'partd >= 0.3.8', 'cloudpickle >= 0.2.1'],
This allows a users to get into the situation where a previously installed and potentially outdated version of numpy is in the environment. This causes an issue when importing dask if the numpy version is less than 1.10.0 because np.cbrt was introduced in numpy version 1.10.0,
In [1]: import dask.dataframe as dd
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-1-e012ff17e82a> in <module>()
----> 1 import dask.dataframe as dd
/home/test/.virtualenvs/dask/lib/python3.4/site-packages/dask/dataframe/__init__.py in <module>()
1 from __future__ import print_function, division, absolute_import
2
----> 3 from .core import (DataFrame, Series, Index, _Frame, map_partitions,
4 repartition, to_delayed, to_datetime, to_timedelta)
5 from .groupby import Aggregation
/home/test/.virtualenvs/dask/lib/python3.4/site-packages/dask/dataframe/core.py in <module>()
17 Cache = dict
18
---> 19 from .. import array as da
20 from .. import core
21 from ..utils import partial_by_order
/home/test/.virtualenvs/dask/lib/python3.4/site-packages/dask/array/__init__.py in <module>()
13 apply_along_axis, apply_over_axes, result_type)
14 from .reshape import reshape
---> 15 from .ufunc import (add, subtract, multiply, divide, logaddexp, logaddexp2,
16 true_divide, floor_divide, negative, power, remainder, mod, conj, exp,
17 exp2, log, log2, log10, log1p, expm1, sqrt, square, cbrt, reciprocal,
/home/test/.virtualenvs/dask/lib/python3.4/site-packages/dask/array/ufunc.py in <module>()
136 sqrt = ufunc(np.sqrt)
137 square = ufunc(np.square)
--> 138 cbrt = ufunc(np.cbrt)
139 reciprocal = ufunc(np.reciprocal)
140
AttributeError: 'module' object has no attribute 'cbrt'
There was an existing issue #2596 where another user had the same problem which was closed.
Python environment:
Python version: 3.4.3
Libraries:
cloudpickle (0.4.0)
dask (0.15.4)
locket (0.2.0)
numpy (1.9.1)
pandas (0.20.3)
partd (0.3.8)
pip (9.0.1)
python-dateutil (2.6.1)
pytz (2017.2)
setuptools (36.6.0)
six (1.11.0)
toolz (0.8.2)
wheel (0.30.0)
Copy and paste example:
import dask.dataframe as dd
print('test is complete')
Is there a reason as to why the setup.py could not be modified to contain numpy>=1.10.0?
13 'dataframe': ['numpy>=1.10.0', 'pandas >= 0.19.0', 'toolz >= 0.7.3',
14 'partd >= 0.3.8', 'cloudpickle >= 0.2.1'],
Metadata
Metadata
Assignees
Labels
No labels
Activity
mrocklin commentedon Oct 19, 2017
Seems reasonable to me. It looks like we also don't mention a minimum version in the conda-forge recipe: https://github.com/conda-forge/dask-feedstock/blob/master/recipe/meta.yaml
The next question is probably "what is the minimum version?"
This issue might interest @jakirkham
jakirkham commentedon Oct 19, 2017
Agreed. I guess the oldest one we test in CI, which IIRC is NumPy 1.10. Though I do remember seeing compatibility code for earlier versions. Maybe it's time to revisit what compatibility code is still needed and what can be dropped.
djkirkham commentedon Nov 8, 2017
There appear to be errors with the masking functionality with numpy <1.12:
jakirkham commentedon Nov 20, 2017
Considering the masked array functionality is relatively new and may have some rough areas, would not suggest setting the NumPy minimum version based on it. Instead would suggest that bugs related to masked array support be raised in fresh issues where they can be addressed more appropriately.
jakirkham commentedon Mar 13, 2018
Have added PR ( #3283 ) to set the minimum version of NumPy supported to be 1.10.4 as that is the oldest version we run CI against. Also have seen evidence that some things we include (e.g. wrapping
cbrt) don't work on NumPy 1.9. We should probably follow this PR with a bit of spring cleaning as there is back compat code for versions of NumPy earlier than 1.10.