为什么微调Python显示TypeError:可以用抽象方法实例化抽象类实例
0
虽然我在PC上安装了Minizinc!仍然遇到此错误: - > 12实例=实例(gecode,nqueens) Importerror:无法从“ minizinc”导入“实例”,所以 我修改了代码: 从minizinc.ignance Import实例 但是我有: ---> 12实例=实例(gecode,nqueens) TYPEERROR:无法用抽象方法初始化,分支,方法,解决方案实例化抽象类实例
: minizinc python安装 但是没有结果
0
Though i've Minizinc installed in my PC! still getting this error:
--> 12 instance = Instance(gecode, nqueens)
ImportError: cannot import name 'Instance' from 'minizinc' So,
i modified the code :
from minizinc.instance import Instance
But i've got:
---> 12 instance = Instance(gecode, nqueens)
TypeError: Can't instantiate abstract class Instance with abstract methods init, branch, method, solutions
trying to follow :
minizinc python installation
but without a result
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来您正在使用Jupyter笔记本,该笔记本有一个已知的问题:由于它使用异步Python循环,因此它无法称呼任何本身也称为异步Python循环的内容。对于minizinc python,这里进行了讨论: https://githbithub.com/github.com/minizinc/minizinc/minizinc-/minizinc-/minizinc--------- python/essess/38 也提供了一些解决方案
It sounds like you are using a Jupyter notebook, which has a known problem: since it uses asynchronous Python loop, it cannot call anything that itself also calls an asynchronous Python loop. For MiniZinc Python this is discussed here: https://github.com/MiniZinc/minizinc-python/issues/38 which also gives a few solutions