Scikit learn 没有名为base的模块

Scikit learn 没有名为base的模块,scikit-learn,installation,confusion-matrix,Scikit Learn,Installation,Confusion Matrix,所以我试着跑 import sklearn.metrics import confusion_matrix 所以,嘿,让我们重新安装一切新鲜的,因为没有其他似乎工作 Blakes-MacBook-Pro:P3 bmc$ sudo apt-get install python-sklearn sudo: apt-get: command not found Blakes-MacBook-Pro:P3 bmc$ sudo pip install -U numpy scipy scikit-lear

所以我试着跑

import sklearn.metrics import confusion_matrix
所以,嘿,让我们重新安装一切新鲜的,因为没有其他似乎工作

Blakes-MacBook-Pro:P3 bmc$ sudo apt-get install python-sklearn
sudo: apt-get: command not found
Blakes-MacBook-Pro:P3 bmc$ sudo pip install -U numpy scipy scikit-learn
The directory '/Users/bmc/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/bmc/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already up-to-date: numpy in /Library/Python/2.7/site-packages
Requirement already up-to-date: scipy in /Library/Python/2.7/site-packages
Requirement already up-to-date: scikit-learn in /Library/Python/2.7/site-packages
很好,所以我们都是最新的。伟大的让我们运行它

Blakes-MacBook-Pro:P3 bmc$ python P3.py iris-shuffled.txt iris-shuffled.txt
Traceback (most recent call last):
  File "P3.py", line 26, in <module>
from sklearn.metrics import confusion_matrix
  File "/usr/local/lib/python2.7/site-packages/sklearn/__init__.py", line 57, in <module>

ImportError: No module named base
Blakes MacBook Pro:P3 bmc$python P3.py iris-shuffled.txt iris-shuffled.txt
回溯(最近一次呼叫最后一次):
文件“P3.py”,第26行,在
从sklearn.metrics导入混淆矩阵
文件“/usr/local/lib/python2.7/site packages/sklearn/_init__.py”,第57行,在
ImportError:没有名为base的模块

我不知道什么是
base
,也不知道如何获得它,如果它不在我的sklearn fresh重新安装中,可能有什么问题?

也许你有一大堆不同的python安装:pip谈论的是
/Library/python/2.7
,python似乎是从
/usr/local/lib/python2.7
运行的。另外,请注意,您没有新安装任何东西<代码>apt get失败,pip什么也没做-尝试先卸载软件包。这很有帮助。非常感谢。