【发布时间】:2016-06-06 19:27:33
【问题描述】:
无法让 z3 在 pydev 上运行。
下载z3后,我去eclipse windows > Preferences > PyDev > Interpreters > Python Interpreters 然后将“z3/bin”添加到库中
运行 Python 2.7.11 和 z3 32 位
当我尝试运行简单代码时
from z3 import*
x = Int('x')
y = Int('y')
print simplify(x + y + 2*x + 3)
得到错误
NameError: name 'Int' is not defined
【问题讨论】:
-
Z3 有一个名为 init 的函数,但它不与变量/常量名称一起用作参数。你打算使用 Int(...) 吗?
-
重新检查。是的,它应该是 int。但仍然会出现同样的错误。
标签: python eclipse python-2.7 pydev z3