首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >导入"scipy.ndimage“不能是resolvedPylance (reportMissingImports)

导入"scipy.ndimage“不能是resolvedPylance (reportMissingImports)
EN

Stack Overflow用户
提问于 2022-06-09 23:04:04
回答 1查看 114关注 0票数 0

试图创建一个包含光污染数据的地图。

代码语言:javascript
复制
from scipy.ndimage import imread 

从“导入枕导入imread”中获取一个错误

错误说明:导入"scipy“不能是resolvedPylance (reportMissingImports)

代码语言:javascript
复制
import folium
from folium import plugins
from scipy.ndimage import imread 


# boundary of the image on the map
min_lon = -123.5617
max_lon = -121.0617
min_lat = 37.382166
max_lat = 39.048834

# create the map
map_ = folium.Map(location=[38.2, -122],
                  tiles='Stamen Terrain', zoom_start = 8)

# read in png file to numpy array
data = imread('./ii_overlay.png')

# Overlay the image
map_.add_children(plugins.ImageOverlay(data, opacity=0.8, \
        bounds =[[min_lat, min_lon], [max_lat, max_lon]]))
map_

对此感兴趣的人的完整代码^

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-06-09 23:08:20

您在您的python安装上安装了吗?如果没有,那么使用pip安装它,方法是在linux / mac上使用python3 -m pip install scipy,对windows使用py -3 -m pip install scipy

如果您已经安装了它,但它仍然不能工作,那么尝试比较您安装的python的版本和vscode正在查看的版本,您可以通过在终端中键入pip -VV来检查安装到哪个版本,对于vs代码,它的使用在左下角显示的版本只需确保这些版本是相同的(您可以通过单击左下角的版本或在命令托盘中键入Python: Select Interpreter来更改vs代码。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72567499

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档