【问题标题】:Kernel keeps dying and can't compile code (osmnx)内核一直死机,无法编译代码(osmnx)
【发布时间】:2020-05-13 03:40:21
【问题描述】:

晚上好,我目前正在尝试从多边形下载数据,但由于内核不断死亡,我无法编译代码。 代码如下:

import geopandas as gpd 
import pandas as pd 
from shapely.geometry import Point, LineString, Polygon 
import networkx as nx 
import osmnx as ox 
import matplotlib.pyplot as plt 
from descartes import PolygonPatch 
from IPython.display import IFrame 
ox.config(log_console=True, use_cache=True)

place = 'Portugal'

G = ox.gdf_from_place(place)

exploded_G = G.explode()

exploded_G['area'] = exploded_G.area
exploded_G.sort_values(by='area', inplace=True)

Portugal= exploded_G.iloc[-1]['geometry']

g = ox.graph_from_polygon(polygon = Portugal, network_type = 'drive')

内核在我分享的最后一行代码中死掉了。我不知道为什么,我在 anaconda 中创建了一个新环境并再次运行代码,内核又一次死了。我已经卸载并安装了 anaconda 和几个软件包。然而我的努力并没有成功。

提前感谢您的帮助。

最好的问候。

【问题讨论】:

  • 您可以将错误消息添加到您的帖子中吗?这将有助于查明错误。
  • 内核重新启动 Desktop/osmnx_project.ipynb 的内核似乎已经死机。它会自动重启。

标签: python python-3.x jupyter jupyter-lab osmnx


【解决方案1】:

事实证明这是一个 RAM 问题,而且 Jupyter 不是合适的编译器。尝试使用 PyCharm 或 spyder 或 ohter。

【讨论】:

    猜你喜欢
    • 2019-07-31
    • 2019-08-01
    • 2021-10-03
    • 2012-01-02
    • 1970-01-01
    • 2011-07-01
    • 1970-01-01
    • 2020-10-02
    • 2012-10-07
    相关资源
    最近更新 更多