python - TypeError:绘图不可用(Google Colab)
问题描述
这是我在使用情节时遇到的错误。imort cairo 没有给出任何错误,这意味着 igraph 用于绘图的库已安装,但仍显示错误。谁能帮我解决这个问题。
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-18-8ddaf3cef6bc> in <module>()
1 layout = G.layout("kk")
----> 2 plot(G , layout = layout)
2 frames
/usr/local/lib/python3.6/dist-packages/igraph/drawing/__init__.py in plot(obj, target, bbox, *args, **kwds)
444 bbox = BoundingBox(bbox)
445
--> 446 result = Plot(target, bbox, background=kwds.get("background", "white"))
447
448 if "margin" in kwds:
/usr/local/lib/python3.6/dist-packages/igraph/drawing/__init__.py in __init__(self, target, bbox, palette, background)
115 """
116 self._filename = None
--> 117 self._surface_was_created = not isinstance(target, cairo.Surface)
118 self._need_tmpfile = False
119
/usr/local/lib/python3.6/dist-packages/igraph/drawing/utils.py in __getattr__(self, _)
394
395 def __getattr__(self, _):
--> 396 raise TypeError("plotting not available")
397 def __call__(self, _):
398 raise TypeError("plotting not available")
TypeError: plotting not available
解决方案
推荐阅读
- html - 使用类别时,有没有办法在 vuetify 日历中添加水平滚动?
- python - 尝试将 matplotlib 窗口设置为大于屏幕,其他发布的解决方案不起作用
- javascript - Web 浏览器 Javascript 应用程序与另一台运行相同应用程序的本地计算机通信
- r - 如何在 R 中创建具有匹配行和列的 data.frame 列表
- c - libnl:设置接口 IPv6 地址时的段错误
- pytorch - 带有 3D 输入的 PyTorch LinearLayer+BatchNorm1d
- mysql - MySQL - 找到一个不同的值,但前提是它对于某些变量是正确的
- python - Scrapy - 比 start_urls 优先的下一个链接
- microsoft-graph-api - 如何使用 Microsoft Graph API 拨打电话号码?
- kubernetes - 在 k8s 中,如何在复制控制器中部署 pod?