Comments (4)
Hmm, two things are confusing me.
- Why does it say
sckit-learn 0.22.1
in that traceback? - Exactly whose code is running there? Can you post the full traceback (ideally the text, not a screenshot)?
I'm also surprised to see dask-ml using pkg_resources in https://github.com/dask/dask-ml/blob/main/dask_ml/__init__.py. I don't think that's the recommended way to do things with setuptools-scm these days (https://pypi.org/project/setuptools-scm/).
A PR to update the packaging stuff would be most welcome!
from dask-ml.
- Why does it say sckit-learn 0.22.1 in that traceback?
Good question. Not sure ..
Exactly whose code is running there? Can you post the full traceback (ideally the text, not a screenshot)?
Sure
BTW, I have reinstalled the dask to the most up to date version, and now the error is different.
dask version = 2023.5.0
Whole error message below:
ImportError Traceback (most recent call last)
Cell In[9], line 1
----> 1 import dask_ml
File /anaconda/envs/azureml_py38/lib/python3.8/site-packages/dask_ml/__init__.py:4
1 from pkg_resources import DistributionNotFound, get_distribution
3 # Ensure we always register tokenizers
----> 4 from dask_ml.model_selection import _normalize
6 __all__ = []
8 try:
File /anaconda/envs/azureml_py38/lib/python3.8/site-packages/dask_ml/model_selection/__init__.py:6
1 """Utilities for hyperparameter optimization.
2
3 These estimators will operate in parallel. Their scalability depends
4 on the underlying estimators being used.
5 """
----> 6 from ._hyperband import HyperbandSearchCV
7 from ._incremental import IncrementalSearchCV, InverseDecaySearchCV
8 from ._search import GridSearchCV, RandomizedSearchCV, check_cv, compute_n_splits
File /anaconda/envs/azureml_py38/lib/python3.8/site-packages/dask_ml/model_selection/_hyperband.py:12
9 import numpy as np
10 from sklearn.utils import check_random_state
---> 12 from ._incremental import BaseIncrementalSearchCV
13 from ._successive_halving import SuccessiveHalvingSearchCV
15 logger = logging.getLogger(__name__)
File /anaconda/envs/azureml_py38/lib/python3.8/site-packages/dask_ml/model_selection/_incremental.py:19
17 import scipy.stats
18 import toolz
---> 19 from dask.distributed import Future, default_client, futures_of, wait
20 from distributed.utils import log_errors
21 from sklearn.base import BaseEstimator, clone
File /anaconda/envs/azureml_py38/lib/python3.8/site-packages/dask/distributed.py:11
3 _import_error_message = (
4 "dask.distributed is not installed.\n\n"
5 "Please either conda or pip install distributed:\n\n"
6 " conda install dask distributed # either conda install\n"
7 ' python -m pip install "dask[distributed]" --upgrade # or pip install'
8 )
10 try:
---> 11 from distributed import *
12 except ImportError as e:
13 if e.msg == "No module named 'distributed'":
File /anaconda/envs/azureml_py38/lib/python3.8/site-packages/distributed/__init__.py:7
4 from dask.utils import import_required
6 from ._version import get_versions
----> 7 from .actor import Actor, ActorFuture
8 from .client import (
9 Client,
10 CompatibleExecutor,
(...)
20 wait,
21 )
22 from .core import Status, connect, rpc
File /anaconda/envs/azureml_py38/lib/python3.8/site-packages/distributed/actor.py:6
3 import threading
4 from queue import Queue
----> 6 from .client import Future, default_client
7 from .protocol import to_serialize
8 from .utils import iscoroutinefunction, sync, thread_state
File /anaconda/envs/azureml_py38/lib/python3.8/site-packages/distributed/client.py:30
28 import dask
29 from dask.base import collections_to_dsk, normalize_token, tokenize
---> 30 from dask.compatibility import apply
31 from dask.core import flatten
32 from dask.highlevelgraph import HighLevelGraph
ImportError: cannot import name 'apply' from 'dask.compatibility' (/anaconda/envs/azureml_py38/lib/python3.8/site-packages/dask/compatibility.py)
from dask-ml.
For that new error message, you'll want to ensure that your versions of dask and distributed match.
from dask-ml.
Thanks @TomAugspurger
Indeed upgrading dask[distributed] using python -m pip install "dask[distributed]" --upgrade
as was mentioned in the error message did solve the issue!
Thanks for the help!!!
from dask-ml.
Related Issues (20)
- Mistake.
- Add backward compatibility for supported version of scikit-learn
- Bug in ColumnTransformer HOT 2
- HashingVectorizer behaves differently from FeatureHasher HOT 1
- sklearn handles text labels differently than ml_dask on OneHotEncoding
- Implementation for make_s_curve HOT 2
- Import dask_ml with python 3.10 failed due to conflict with dask.distributed HOT 4
- Python 3.11 support HOT 2
- LogisticRegression.score returns an empty dask array
- Incremental does not handle dask arrays of ndim>2 in estimator training HOT 2
- For a single record data frame train_test_split() sometimes assigns this single record to test set. HOT 2
- The `log_loss`-function crashes when using mixed types
- Area under the receiving operating characteristic curve (AUROC) calculation. HOT 2
- The latest version doesn't support perceptron model
- sklearn StandardScaler vs dask StandardScaler. HOT 1
- Nearest Neighbors
- `TypeError` when predicting non-array data with `dask-expr` HOT 6
- Undeclared runtime dependency on setuptools HOT 1
- Documentation on PCA expected max memory usage HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dask-ml.