试图创建一个包含光污染数据的地图。
from scipy.ndimage import imread 从“导入枕导入imread”中获取一个错误
错误说明:导入"scipy“不能是resolvedPylance (reportMissingImports)
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_对此感兴趣的人的完整代码^
发布于 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代码。
https://stackoverflow.com/questions/72567499
复制相似问题