runsnake在ubuntu中失败,在squaremap中出现错误



当我用启动runsnake时

$ runsnake test.profile

窗口打开,但没有图形,也没有源代码(只有调用列表等(。在控制台上,我看到以下错误消息:

11:18:17: Debug: Adding duplicate image handler for 'PNG file'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/wx/core.py", line 3282, in <lambda>
lambda event: event.callable(*event.args, **event.kw) )
File "/usr/lib/python3/dist-packages/runsnakerun/runsnake.py", line 701, in load
self.SetModel(self.loader)
File "/usr/lib/python3/dist-packages/runsnakerun/runsnake.py", line 738, in SetModel
self.squareMap.SetModel(tree, self.adapter)
File "/usr/lib/python3/dist-packages/squaremap/squaremap.py", line 221, in SetModel
self.UpdateDrawing()
File "/usr/lib/python3/dist-packages/squaremap/squaremap.py", line 247, in UpdateDrawing
self.Draw(dc)
File "/usr/lib/python3/dist-packages/squaremap/squaremap.py", line 257, in Draw
font = self.FontForLabels(dc)
File "/usr/lib/python3/dist-packages/squaremap/squaremap.py", line 267, in FontForLabels
font.SetPointSize(scale * font.GetPointSize())
TypeError: Font.SetPointSize(): argument 1 has unexpected type 'float'

我使用安装了runsnake

sudo apt-get install runsnake

根据pip list:,依赖关系的版本为

RunSnakeRun            2.0.5
SquareMap              1.0.5
wxPython               4.0.7

我的系统是

PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"

快速破解是通过修改代码来更改运行的代码:

$ sudo $EDITOR /usr/lib/python3/dist-packages/squaremap/squaremap.py

转到第267行

然后将该行替换为:

font.SetPointSize(int(scale * font.GetPointSize()))

或硬编码:

font.SetPointSize(18)

相关内容

  • 没有找到相关文章

最新更新