已安装的python包numpy和scipy的导入错误,但scikitlearn工作正常

2024-04-24 13:37:02 发布

您现在位置:Python中文网/ 问答频道 /正文

我在我的windows8系统上安装了scikit learn、numpy和scipy包。我使用python3.5 当我尝试导入sklearn时,效果很好,但是Importerror发生在numpy和scipy身上。此外,虽然sklearn导入成功,但我无法从中导入特定模块它。拜托请参见下面的代码片段:

C:\Users\CAN U VISH>python
Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:38:48) [MSC v.1900 32 bit       (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'numpy'
>>> import scipy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'scipy'
>>> import sklearn
Import Success
>>> from sklearn import datasets
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'datasets'
>>>

另外,由于pip安装失败,我用miniconda安装了numpy和scipy


Tags: inimportnumpymoststdinlinescipysklearn