资讯详情

Python 版本不匹配导致 labelimg 闪退

📅 2026/9/27 9:37:00 | 华诺云谱 👁 阅读
Python 版本不匹配导致 labelimg 闪退
滚轮闪退D:\Anaconda\envs\你安装labelimg的虚拟环境名称\Lib\site-packages\labelImg根据自己的文件存储路径修改找到 labelImg.py修改def scroll_request()函数def scroll_request(self, delta, orientation): units - delta / (8 * 15) bar self.scroll_bars[orientation] # bar.setValue(bar.value() bar.singleStep() * units) bar.setValue(int(bar.value() bar.singleStep() * units))Create RectBox 闪退D:\Anaconda\envs\你安装labelimg的虚拟环境名称\Lib\site-packages\libs根据自己的文件存储路径修改找到 canvas.py修改 # Paint rect 部分代码if self.current is not None and len(self.line) 2: left_top self.line[0] right_bottom self.line[1] rect_width right_bottom.x() - left_top.x() rect_height right_bottom.y() - left_top.y() p.setPen(self.drawing_rect_color) brush QBrush(Qt.BDiagPattern) p.setBrush(brush) lx int(round(left_top.x())) ly int(round(left_top.y())) rw int(round(rect_width)) rh int(round(rect_height)) p.drawRect(lx, ly, rw, rh) # p.drawRect(left_top.x(), left_top.y(), rect_width, rect_height) if self.drawing() and not self.prev_point.isNull() and not self.out_of_pixmap(self.prev_point): p.setPen(QColor(0, 0, 0)) x int(round(self.prev_point.x())) p.drawLine(x, 0, x, int(self.pixmap.height())) # p.drawLine(self.prev_point.x(), 0, self.prev_point.x(), self.pixmap.height()) y int(round(self.prev_point.y())) p.drawLine(0, y, int(self.pixmap.width()), y) # p.drawLine(0, self.prev_point.y(), self.pixmap.width(), self.prev_point.y())
📝

华诺云谱内容团队

资深建站顾问 · 行业研究员

10年+企业数字化服务经验,专注智能建站、SEO优化与品牌营销,持续输出建站技巧、行业洞察与营销干货,已帮助5000+企业实现数字化增长。

你可能需要的服务

订阅华诺云谱资讯周报

每周一封,精选建站技巧、SEO与营销干货,直达邮箱。已有 8,000+ 企业主订阅,助你少走弯路。

↑