在 Windows 上安装 Z3 + Python [英] Installing Z3 + Python on Windows

查看:30
本文介绍了在 Windows 上安装 Z3 + Python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很难让 Z3 Python 前端在带有 Z3 4.3.0 版的 Windows 7 上从 codeplex 运行.作为 MSI 文件分发的旧版本 4.1.2 在我的 Windows 7 上运行良好.

I am having some hard time getting the Z3 Python frontend to work on Windows 7 with Z3 version 4.3.0 from codeplex. The older version 4.1.2 that was distributed as an MSI file works fine on my Windows 7.

首先,我无法使用 codeplex 中的源代码来构建 Z3,因为我没有 Visual Studio 命令提示符(我真的需要它吗?).所以我下载了二进制文件 32 位版本并将该目录添加到我的 PYTHONPATH.这允许我做 import z3 ,但我不能再使用它,因为错误 Z3Exception: 'init(Z3_LIBRARY_PATH) must be called before using Z3-python' .文件 z3.dll 不包含在下载文件中.

First, I cannot use the source code from codeplex to build Z3 because I don't have Visual studio Command Prompt (do I really need it?). So I download the binary file 32 bit version and add that directory to my PYTHONPATH. This allows me to do import z3 , but I cannot use it any further because of the error Z3Exception: 'init(Z3_LIBRARY_PATH) must be invoked before using Z3-python' . The file z3.dll is not included in the download file.

我在 Mac 或 Linux 上设置 Z3 v4.3 没有问题.

I have no problem setting Z3 v4.3 on my Mac or Linux.

推荐答案

Visual Studio Express 应该足以编译 Z3 并且可以从 Microsoft 免费获得,此处.但是,使用 Z3Py 并不要求从头编译 Z3.

Visual Studio Express should be enough to compile Z3 and is available for free from Microsoft, here. However, it's not a requirement that Z3 be compiled from scratch to use Z3Py.

从 4.3.0 版开始,该 DLL 现在称为 libz3.dll,我刚刚验证它确实包含在从 Codeplex 下载的文件中,并且当我将它添加到 PYTHONPATH 时它运行良好.我可以想象你的情况出了什么问题是你将目录 C:...\z3-4.3.0-x86 添加到 PYTHONPATH,而 C:...\z3-4.3.0-x86 是必要的\bin 被添加(注意末尾的 \bin).

Starting with version 4.3.0, the DLL is now called libz3.dll and I just verified that it is indeed included in the download from Codeplex and it executes fine when I add it to PYTHONPATH. I can imagine that what went wrong in your case is that you added the directory C:...\z3-4.3.0-x86 to PYTHONPATH, while it is necessary that C:...\z3-4.3.0-x86\bin be added (note the \bin in the end).

这篇关于在 Windows 上安装 Z3 + Python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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