几个月前,我把spyder安装在我的电脑上,它一直运转良好,直到我需要制作一张贴有地块和地形图的地图。我只是尝试导入matplotlib-basemap并获得以下错误:
文件"",第1行,在runfile('C:/Users/Isa/Documents/Freedman/2018/ENVIROCOMP/Stationplots.py',wdir='C:/Users/Isa/Documents/Freedman/2018/ENVIROCOMP')中 文件"C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py",第710行,在runfile execfile中(文件名,命名空间) 文件"C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py",第101行,在execfile (f.read(),filename,'exec'),命名空间中 文件"C:/Users/Isa/Documents/Freedman/2018/ENVIROCOMP/Stationplots.py",第15行,从mpl_toolkits.basemap导入Basemap,shiftgrid,cm 文件“< importlib._bootstrap>",第971行,在_find_and_load中 文件“< importlib._bootstrap>",第951行,在_find_and_load_unlocked中 文件“< importlib._bootstrap>",第890行,在_find_spec中 文件“< importlib._bootstrap>",第864行,在_find_spec_legacy中 文件"C:\ProgramData\Anaconda3\lib\site-packages\pyximport\pyximport.py",第253行,在find_module fp中,路径名,(ext,mode,ty) =imp.find_module(全名,package_path) 文件"C:\ProgramData\Anaconda3\lib\imp.py",第271行,在find_module "not {}“.format(类型(路径))中 RuntimeError:“path”必须是“无”或“列表”,而不是冻结_importlib_external._NamespacePath’>
如果有人曾经经历过这种错误,或者理解了这种错误,那么建议一种让basemap在spyder上工作的方法吗?
发布于 2018-05-29 19:55:27
这个错误是在我们的3.2.8版本中修复的,发布于3/2018年。
由于您使用的是Anaconda,请打开Anaconda提示符并在那里运行
conda update spyder
去解决问题。
https://stackoverflow.com/questions/50591637
复制相似问题