我正在尝试使用包scikit-learn
。我已使用conda
和pip
函数成功安装了它。但是在尝试使用它时:
from sklearn.feature_extraction.text import TfidfVectorizer
我收到以下错误....
ImportError Traceback (most recent call last)
<ipython-input-22-c359d56bf3d1> in <module>()
1 ## Trying a different alternative with Stikitlearn package
2
----> 3 from sklearn.feature_extraction.text import TfidfVectorizer
C:\Users\0806655a\AppData\Local\Continuum\Anaconda3\lib\site-packages\sklearn\feature_extraction\__init__.py in <module>()
8 from .hashing import FeatureHasher
9 from .image import img_to_graph, grid_to_graph
---> 10 from . import text
11
12 __all__ = ['DictVectorizer', 'image', 'img_to_graph', 'grid_to_graph', 'text',
C:\Users\0806655a\AppData\Local\Continuum\Anaconda3\lib\site-packages\sklearn\feature_extraction\text.py in <module>()
27 from ..externals import six
28 from ..externals.six.moves import xrange
---> 29 from ..preprocessing import normalize
30 from .hashing import FeatureHasher
31 from .stop_words import ENGLISH_STOP_WORDS
C:\Users\0806655a\AppData\Local\Continuum\Anaconda3\lib\site-packages\sklearn\preprocessing\__init__.py in <module>()
29 from .label import MultiLabelBinarizer
30
---> 31 from .imputation import Imputer
32
33
C:\Users\0806655a\AppData\Local\Continuum\Anaconda3\lib\site-packages\sklearn\preprocessing\imputation.py in <module>()
7 import numpy.ma as ma
8 from scipy import sparse
----> 9 from scipy import stats
10
11 from ..base import BaseEstimator, TransformerMixin
C:\Users\0806655a\AppData\Local\Continuum\Anaconda3\lib\site-packages\scipy\stats\__init__.py in <module>()
336 from __future__ import division, print_function, absolute_import
337
--> 338 from .stats import *
339 from .distributions import *
340 from .morestats import *
C:\Users\0806655a\AppData\Local\Continuum\Anaconda3\lib\site-packages\scipy\stats\stats.py in <module>()
181 import scipy.linalg as linalg
182 import numpy as np
--> 183 from . import distributions
184 from . import mstats_basic
185 from ._distn_infrastructure import _lazywhere
C:\Users\0806655a\AppData\Local\Continuum\Anaconda3\lib\site-packages\scipy\stats\distributions.py in <module>()
8 from __future__ import division, print_function, absolute_import
9
---> 10 from ._distn_infrastructure import (entropy, rv_discrete, rv_continuous,
11 rv_frozen)
12
C:\Users\0806655a\AppData\Local\Continuum\Anaconda3\lib\site-packages\scipy\stats\_distn_infrastructure.py in <module>()
6
7 from scipy._lib.six import string_types, exec_
----> 8 from scipy._lib._util import getargspec_no_self as _getargspec
9
10 import sys
ImportError: cannot import name 'getargspec_no_self'
我无法理解'getargspec_no_self'
是什么。任何关于在哪里看的想法都非常受欢迎。
亲切的问候!
答案 0 :(得分:-1)
我使用此how-do-i-fix-importerror-cannot-import-name-incompleteread
的部分解决方案在我的anaconda提示符下,我输入了“易安装点”字样&#39;而问题消失了。我用的是Windows 7&amp; Python 2.7.11