can't use scikit-learn - “AttributeError: 'module' object has no attribute …”

后端 未结 9 715
失恋的感觉
失恋的感觉 2020-12-31 02:57

I\'m trying to follow this tutorial of scikit-learn (linear regression).

I\'ve installed scikit through pip install -U scikit-learn, I use python 2.7 an

9条回答
  •  萌比男神i
    2020-12-31 03:41

    OK.. Found it finally.. Posting it here in case someone will get into the same problem.

    I had another version of sklearn (probably because of apt-get install) in a different directory. It was partially installed somehow but it was the one that got loaded.

    Make sure to look at your pip script's output to see where does it install the package, and when you load it from python, check sklearn.__path__ to see where is it taking it from.

提交回复
热议问题