Z3 Int 未定义错误 [英] Z3 Int not defined error

查看:61
本文介绍了Z3 Int 未定义错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 python 中的 Z3 库,但是它不起作用.它给出了一个错误 Int is not defined.

我使用 pip 安装了 z3 模块,如您所见,导入 lib 时没有抛出错误消息.我使用的是 Mac OS X 和 python 版本 2.7.6

<预><代码>>>>从 z3 导入 *>>>x = Int('x')回溯(最近一次调用最后一次):文件<stdin>",第 1 行,在 <module> 中NameError: 名称 'Int' 未定义

解决方案

我一开始也有同样的问题.

问题的原因是你没有安装正确的包.

正确的包名是z3-solver.

安装:

pip install z3-solver

I am trying to use Z3 library from python however it does not work. It gives an error Int is not defined.

I installed the z3 module using pip and as you can see, there is no error message thrown when I import the lib. I am using Mac OS X and python version 2.7.6

>>> from z3 import *
>>> x = Int('x')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'Int' is not defined

解决方案

I have the same problem at the beginning.

The cause of the problem is that you didn't install the right package.

The right package name is z3-solver.

To install it:

pip install z3-solver

这篇关于Z3 Int 未定义错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆