再次:在 Windows 上安装 Z3 + Python [英] Again: Installing Z3 + Python on Windows

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

问题描述

之前的问题中指出的安装问题仍然存在.我尝试在 Windows XP SP3 32 位和 Windows 7 64 位下安装 Z3 4.3.0 和 4.1.没有一个组合有效!我能够执行from z3 import *",但 Z3 dll 的 init() 失败.我的 Python 版本是 2.7.3.Z3 单机版和 Python 单机版确实可以工作,但它们在没有很多抱怨的情况下无法协同工作.

The installation problems pointed out in an earlier question are still present. I have tried to install Z3 4.3.0 and 4.1 under Windows XP SP3 32-bit and under Windows 7 64-bit. None of the combinations work! I am able to do the "from z3 import *", but the init() of the Z3 dll fails. My Python version is 2.7.3. Z3 stand-alone and Python stand-alone do work, but they don't work together without lots of complaints.

获得回答以下问题的最新安装方法会有所帮助:

It would help to get an up-to-date installation recipe which answers the following questions:

应该使用哪个Z3下载(源码版、预编译版)?

Which Z3 download (source version, precompiled version) should be used?

应该使用哪个 Python 版本?

Which Python version should be used?

在 init() 调用中应该引用哪些或各种 Z3 DLL?一个示例会有所帮助(包括用于带有空格的路径的原始字符串用法).

Which or the various Z3 DLLs should be referenced in the init() call? An example would help (including raw string usage for paths with blanks).

应该使用哪些Z3 Python源文件(Z3的一些下载有*.py文件,其他有*.pyc文件)?编译后的 Python 文件是否与多个 Python 版本兼容?

Which Z3 Python source files should be used (some downloads of Z3 have *.py files, others have *.pyc files)? Are the compiled Python files compatible with more than one Python version?

如何设置PATH和PYTHONPATH?

How to set PATH and PYTHONPATH?

如何以自动提供Z3初始化的方式调用Python的IDLE shell?

How to call the IDLE shell of Python in such a way that Z3 initialization is provided automatically?

抱歉,如果这听起来像是一个新手问题,但是......

Sorry, if this should sound like a newbie question, but ...

推荐答案

Windows XP 不支持 Z3 要求的 DLL 中的线程本地存储.我们目前正在为此进行修复,但无论如何,这意味着即使已修复,您也必须编译自己的 DLL.

Windows XP does not support thread-local storage in DLLs, which Z3 requires. We're currently working on a fix for that, but in any case it will mean that you would have to compile your own DLL even when it's fixed.

在 Windows 7 上,它应该是开箱即用的.但是,您需要确保为 64 位编译所有内容或不编译任何内容.如果您使用的是 32 位 python 版本,它将无法加载 64 位 DLL,反之亦然.Python.org 有两个下载,其中一个标记为 X86-64,即 64-位版本.

On Windows 7, it should work out of the box. However, you need to make sure that either everything or nothing is compiled for 64-bit. If you're using a 32-bit python version, it will not be able to load a 64-bit DLL and vice versa. At Python.org there are two downloads, one of them labeled X86-64, which is the 64-bit version.

最后需要在PYTHONPATH中添加libz3.dll和*.pyc/py所在目录.你可以在系统范围内设置这个(控制面板、系统、高级系统设置、高级、环境变量),然后 IDLE 也应该看到它.

Finally, the directory where libz3.dll and *.pyc/py are located needs to be added to PYTHONPATH. You can set this system-wide (Control Panel, System, Advanced System Settings, Advanced, Environment Variables), then IDLE should see it too.

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

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