Skip to content
This repository has been archived by the owner on Sep 3, 2022. It is now read-only.

scikit-learn installation - numpy.testing.decorators error #2175

Open
OrielResearchCure opened this issue Nov 25, 2020 · 1 comment
Open

Comments

@OrielResearchCure
Copy link

Hello,

I am using datalab python 3 and trying to work with the scikit library.
I tried installing with conda
!conda install -y -c intel scikit-learn
and pip
!pip install scikit-learn
once importing,
import sklearn
I am getting the following error:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-69de748f5954> in <module>()
      1 # from sklearn.decomposition import PCA
----> 2 from sklearn.decomposition import PCA, FastICA,KernelPCA,TruncatedSVD

/usr/local/envs/py3env/lib/python3.5/site-packages/sklearn/__init__.py in <module>()
     80     from . import _distributor_init  # noqa: F401
     81     from . import __check_build  # noqa: F401
---> 82     from .base import clone
     83     from .utils._show_versions import show_versions
     84 

/usr/local/envs/py3env/lib/python3.5/site-packages/sklearn/base.py in <module>()
     18 
     19 from . import __version__
---> 20 from .utils import _IS_32BIT
     21 
     22 _DEFAULT_TAGS = {

/usr/local/envs/py3env/lib/python3.5/site-packages/sklearn/utils/__init__.py in <module>()
     25 from ..exceptions import DataConversionWarning
     26 from .deprecation import deprecated
---> 27 from .fixes import np_version
     28 from .validation import (as_float_array,
     29                          assert_all_finite,

/usr/local/envs/py3env/lib/python3.5/site-packages/sklearn/utils/fixes.py in <module>()
     16 import scipy.sparse as sp
     17 import scipy
---> 18 import scipy.stats
     19 from scipy.sparse.linalg import lsqr as sparse_lsqr  # noqa
     20 

/usr/local/envs/py3env/lib/python3.5/site-packages/scipy/stats/__init__.py in <module>()
    343 from .stats import *
    344 from .distributions import *
--> 345 from .morestats import *
    346 from ._binned_statistic import *
    347 from .kde import gaussian_kde

/usr/local/envs/py3env/lib/python3.5/site-packages/scipy/stats/morestats.py in <module>()
     10                    sqrt, ceil, floor, array, compress,
     11                    pi, exp, ravel, count_nonzero, sin, cos, arctan2, hypot)
---> 12 from numpy.testing.decorators import setastest
     13 
     14 from scipy._lib.six import string_types

ImportError: No module named 'numpy.testing.decorators'



Any idea how to resolve that issue?

Thanks,
eilalan

@Mohit1-K
Copy link

First check version then upgrade numpy/scipy if not upgraded

Using Python3:

pip install numpy==1.20.0
Or
conda install numpy

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants