我该如何解决导入自己的软件包的错误?

时间:2019-03-24 02:45:24

标签: python python-import python-importlib

我从Introduction to Machine Learning with Python这本书中学习了ML。

当我尝试导入并运行mglearn软件包时,出现错误:

In:    import mglearn

--------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-35-26a0454c3f6e> in <module>
----> 1 import mglearn

~\Desktop\Introduction to Machine Learning with Python\ml_project\mglearn\__init__.py in <module>
----> 1 from .import plots
      2 from .import tools
      3 from .plots import cm3, cm2
      4 from .tools import discrete_scatter
      5 from .plot_helpers import ReBl

~\Desktop\Introduction to Machine Learning with Python\ml_project\mglearn\plots.py in <module>
      1 from .plot_linear_svc_regularization import plot_linear_svc_regularization
----> 2 from .plot_interactive_tree import plot_tree_progressive, plot_tree_partition
      3 from .plot_animal_tree import plot_animal_tree
      4 from .plot_rbf_svm_parameters import plot_svm
      5 from .plot_knn_regression import plot_knn_regression

~\Desktop\Introduction to Machine Learning with Python\ml_project\mglearn\plot_interactive_tree.py in <module>
      6 from sklearn.externals.six import StringIO  # doctest: +SKIP
      7 from sklearn.tree import export_graphviz
----> 8 from scipy.misc import imread
      9 from scipy import ndimage
     10 from sklearn.datasets import make_moons

ImportError: cannot import name 'imread' from 'scipy.misc'   (c:\users\boni\appdata\local\programs\python\python37\lib\site-packages\scipy\misc\__init__.py)

我需要做什么来解决问题?

谢谢!

0 个答案:

没有答案