[scikit-learn] error from import sklearn

Lifan Xu xulifan at udel.edu
Thu Jul 28 20:50:41 EDT 2016

Hi guys,

    I am sorry to bother you. But I have a question about using
scikit-learn in ubuntu.

    I installed scikit using:

    sudo apt-get install build-essential python-dev python-numpy
python-numpy-dev python-scipy libatlas-dev g++ python-matplotlib   ipython
    sudo pip install -U scikit-learn

    However, when I try to use scikit, I got this error:

Python 2.7.6 (default, Jun 22 2015, 17:58:13)

[GCC 4.8.2] on linux2

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

>>> from sklearn import datasets

Traceback (most recent call last):

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

  File "/usr/local/lib/python2.7/dist-packages/sklearn/__init__.py", line
57, in <module>

    from .base import clone

  File "/usr/local/lib/python2.7/dist-packages/sklearn/base.py", line 11,
in <module>

    from .utils.fixes import signature

  File "/usr/local/lib/python2.7/dist-packages/sklearn/utils/__init__.py",
line 11, in <module>

    from .validation import (as_float_array,

"/usr/local/lib/python2.7/dist-packages/sklearn/utils/validation.py", line
16, in <module>

    from ..utils.fixes import signature

  File "/usr/local/lib/python2.7/dist-packages/sklearn/utils/fixes.py",
line 322, in <module>

    from ._scipy_sparse_lsqr_backport import lsqr as sparse_lsqr

line 58, in <module>

    from scipy.sparse.linalg.interface import aslinearoperator

  File "/usr/lib/python2.7/dist-packages/scipy/sparse/linalg/__init__.py",
line 108, in <module>

    from .isolve import *

line 6, in <module>

    from .iterative import *

line 11, in <module>

    from scipy.lib.decorator import decorator

  File "/usr/lib/python2.7/dist-packages/scipy/lib/decorator.py", line 39,
in <module>

    import sys, re, inspect

  File "/usr/lib/python2.7/inspect.py", line 37, in <module>

    import dis

  File "/usr/lib/python2.7/dis.py", line 7, in <module>

    from opcode import __all__ as _opcodes_all

ImportError: cannot import name __all__

    Anyone knows how to fix this problem?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20160728/06f408ee/attachment.html>

More information about the scikit-learn mailing list