【问题标题】:Can't import a package in Spyder while can import in python terminal无法在 Spyder 中导入包,而可以在 python 终端中导入
【发布时间】:2018-02-13 10:51:56
【问题描述】:

当我使用 Python 终端时,完全没有导入问题。但是,当我尝试导入 keras 或尝试使用 scipy.misc.imsave() 时,Spyder 分别表示 ModuleNotFoundAttributeError: module 'scipy.misc' has no attribute 'imsave'。下面是 python 终端和 Spyder 的 sys.path。我希望能解决这个问题。

Python 3.6.3 终端

    ['', 
'C:\\Users\\kaany\\AppData\\Local\\Programs\\Python\\Python36\\python36.zip',
    'C:\\Users\\kaany\\AppData\\Local\\Programs\\Python\\Python36\\DLLs',
    'C:\\Users\\kaany\\AppData\\Local\\Programs\\Python\\Python36\\lib',
    'C:\\Users\\kaany\\AppData\\Local\\Programs\\Python\\Python36', 
    'C:\\Users\\kaany\\AppData\\Local\\Programs\\Python\\Python36\\lib\\site-packages', 
    'C:\\Users\\kaany\\AppData\\Local\\Programs\\Python\\Python36\\lib\\site-packages\\mudicom-0.1.2-py3.6.egg']

蜘蛛

['',
 'C:\\Users\\kaany\\Anaconda3\\python36.zip',
 'C:\\Users\\kaany\\Anaconda3\\DLLs',
 'C:\\Users\\kaany\\Anaconda3\\lib',
 'C:\\Users\\kaany\\Anaconda3',
 'C:\\Users\\kaany\\Anaconda3\\lib\\site-packages',
 'C:\\Users\\kaany\\Anaconda3\\lib\\site-packages\\Babel-2.5.0-py3.6.egg',
 'C:\\Users\\kaany\\Anaconda3\\lib\\site-packages\\Mako-1.0.7-py3.6.egg',
 'C:\\Users\\kaany\\Anaconda3\\lib\\site-packages\\win32',
 'C:\\Users\\kaany\\Anaconda3\\lib\\site-packages\\win32\\lib',
 'C:\\Users\\kaany\\Anaconda3\\lib\\site-packages\\Pythonwin',
 'C:\\Users\\kaany\\Anaconda3\\lib\\site-packages\\IPython\\extensions',
 'C:\\Users\\kaany\\.ipython']

【问题讨论】:

    标签: python path spyder


    【解决方案1】:
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-03-07
    • 2020-02-08
    • 2019-10-03
    • 2018-02-09
    • 2018-10-09
    • 2019-12-28
    • 1970-01-01
    相关资源
    最近更新 更多